3 * Definitions for the Wireshark Memory Manager Allocator
4 * Copyright 2012, Evan Huus <eapache@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __WMEM_ALLOCATOR_H__
14 #define __WMEM_ALLOCATOR_H__
21 #endif /* __cplusplus */
23 struct _wmem_user_cb_container_t
;
25 /* See section "4. Internal Design" of doc/README.wmem for details
26 * on this structure */
27 struct _wmem_allocator_t
{
28 /* Consumer functions */
29 void *(*walloc
)(void *private_data
, const size_t size
);
30 void (*wfree
)(void *private_data
, void *ptr
);
31 void *(*wrealloc
)(void *private_data
, void *ptr
, const size_t size
);
33 /* Producer/Manager functions */
34 void (*free_all
)(void *private_data
);
35 void (*gc
)(void *private_data
);
36 void (*cleanup
)(void *private_data
);
39 struct _wmem_user_cb_container_t
*callbacks
;
41 /* Implementation details */
43 enum _wmem_allocator_type_t type
;
49 #endif /* __cplusplus */
51 #endif /* __WMEM_ALLOCATOR_H__ */
54 * Editor modelines - https://www.wireshark.org/tools/modelines.html
59 * indent-tabs-mode: nil
62 * vi: set shiftwidth=4 tabstop=8 expandtab:
63 * :indentSize=4:tabSize=8:noTabs=true: