Commit Graph

4 Commits

Author SHA1 Message Date
Evan Huus 1f265368c4 Add jumbo-allocation support to wmem fast block
As it turns out, we do occasionally need it.

Bug:10115
Change-Id: Ifec79e4d2470bbc09f15674534d01418a6571a0d
Reviewed-on: https://code.wireshark.org/review/1688
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-23 03:37:53 +00:00
Evan Huus 16dfe11b24 Several tweaks to fast block allocator
- manually inline wmem_block_fast_add_to_block_list, it was only two lines and
  only called twice, so the function boilerplate was outweighing the abstraction

- change free_all to release all but one block to the OS immediately, making gc
  a no-op; the alloc logic doesn't reuse later blocks anyways, so this was
  effectively a leak

Change-Id: I033fbb2f3d87e58c7346cba10f2c710eaaa49e9f
Reviewed-on: https://code.wireshark.org/review/1499
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-05 06:05:18 +00:00
Jakub Zawadzki f13bbf2707 Fast block allocator: make wmem_block_fast_hdr_t single linked list.
Double linked list was required by jumbo allocation.
No support for jumbo -> no need for double linked list -> have only 'next' pointer in header.

Change-Id: I48a0f468ebba9db3a63548d8e7307b6424c759ed
Reviewed-on: https://code.wireshark.org/review/1495
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 03:57:51 +00:00
Jakub Zawadzki 5f239013e7 wmem: add new simple block allocator, use it in packet-scope.
For packet-scope allocation, there's no need to support realloc(), free()
cause memory will be garbage collected after packet dissection.

(and this allocator is much faster than full block allocator).

Change-Id: I73fdf708c3077f48f55bdcc71f4fa859e4ac2335
Reviewed-on: https://code.wireshark.org/review/1428
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-02 21:07:07 +00:00