Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
wmem_allocator_simple.h File Reference
#include "wmem_core.h"

Go to the source code of this file.

Functions

void wmem_simple_allocator_init (wmem_allocator_t *allocator)
 Initialize a simple memory allocator.
 

Detailed Description

Definitions for the Wireshark Memory Manager Simple Allocator Copyright 2012, Evan Huus eapac.nosp@m.he@g.nosp@m.mail..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ wmem_simple_allocator_init()

void wmem_simple_allocator_init ( wmem_allocator_t allocator)

Initialize a simple memory allocator.

Sets up a wmem_allocator_t to use a simple allocation strategy that tracks allocated pointers in an internal array. This allocator is suitable for basic memory management tasks and provides cleanup and garbage collection support.

Initializes function pointers for allocation, reallocation, freeing, and cleanup, and allocates an internal pointer array for tracking allocations.

Parameters
allocatorPointer to the allocator structure to initialize.
Note
After initialization, the allocator can be used for simple memory operations. The allocator must not be NULL.