|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Internal memory allocator interface used by the wmem subsystem. More...
#include <wmem_allocator.h>
Public Attributes | |
| void *(* | walloc )(void *private_data, const size_t size) |
| void(* | wfree )(void *private_data, void *ptr) |
| void *(* | wrealloc )(void *private_data, void *ptr, const size_t size) |
| void(* | free_all )(void *private_data) |
| void(* | gc )(void *private_data) |
| void(* | cleanup )(void *private_data) |
| struct _wmem_user_cb_container_t * | callbacks |
| void * | private_data |
| enum _wmem_allocator_type_t | type |
| bool | in_scope |
Internal memory allocator interface used by the wmem subsystem.
This structure defines the contract between the wmem core and a specific allocator implementation. It includes consumer-facing allocation functions, producer-side lifecycle management, and internal state tracking.
For design details, see section "4. Internal Design" of doc/README.wmem.
| struct _wmem_user_cb_container_t* _wmem_allocator_t::callbacks |
Optional user-defined callbacks for lifecycle events.
| void(* _wmem_allocator_t::cleanup) (void *private_data) |
Final cleanup before allocator destruction.
| void(* _wmem_allocator_t::free_all) (void *private_data) |
Free all allocations managed by this allocator.
| void(* _wmem_allocator_t::gc) (void *private_data) |
Perform garbage collection or cleanup.
| bool _wmem_allocator_t::in_scope |
Indicates whether the allocator is currently active in a scope.
| void* _wmem_allocator_t::private_data |
Allocator-specific internal state.
| enum _wmem_allocator_type_t _wmem_allocator_t::type |
Allocator type (e.g., scope, file-backed, slab).
| void *(* _wmem_allocator_t::walloc) (void *private_data, const size_t size) |
Allocate memory of given size.
| void(* _wmem_allocator_t::wfree) (void *private_data, void *ptr) |
Free previously allocated memory.
| void *(* _wmem_allocator_t::wrealloc) (void *private_data, void *ptr, const size_t size) |
Resize an existing allocation.