Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Attributes | List of all members
_wmem_allocator_t Struct Reference

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_tcallbacks
 
void * private_data
 
enum _wmem_allocator_type_t type
 
bool in_scope
 

Detailed Description

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.

Member Data Documentation

◆ callbacks

struct _wmem_user_cb_container_t* _wmem_allocator_t::callbacks

Optional user-defined callbacks for lifecycle events.

◆ cleanup

void(* _wmem_allocator_t::cleanup) (void *private_data)

Final cleanup before allocator destruction.

◆ free_all

void(* _wmem_allocator_t::free_all) (void *private_data)

Free all allocations managed by this allocator.

◆ gc

void(* _wmem_allocator_t::gc) (void *private_data)

Perform garbage collection or cleanup.

◆ in_scope

bool _wmem_allocator_t::in_scope

Indicates whether the allocator is currently active in a scope.

◆ private_data

void* _wmem_allocator_t::private_data

Allocator-specific internal state.

◆ type

enum _wmem_allocator_type_t _wmem_allocator_t::type

Allocator type (e.g., scope, file-backed, slab).

◆ walloc

void *(* _wmem_allocator_t::walloc) (void *private_data, const size_t size)

Allocate memory of given size.

◆ wfree

void(* _wmem_allocator_t::wfree) (void *private_data, void *ptr)

Free previously allocated memory.

◆ wrealloc

void *(* _wmem_allocator_t::wrealloc) (void *private_data, void *ptr, const size_t size)

Resize an existing allocation.


The documentation for this struct was generated from the following file: