TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / wsutil / wmem / wmem_allocator.h
blob8890054aaaf2b4b9a2a0fe241079d64e8ef63024
1 /** @file
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__
16 #include <glib.h>
17 #include <string.h>
19 #ifdef __cplusplus
20 extern "C" {
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);
38 /* Callback List */
39 struct _wmem_user_cb_container_t *callbacks;
41 /* Implementation details */
42 void *private_data;
43 enum _wmem_allocator_type_t type;
44 bool in_scope;
47 #ifdef __cplusplus
49 #endif /* __cplusplus */
51 #endif /* __WMEM_ALLOCATOR_H__ */
54 * Editor modelines - https://www.wireshark.org/tools/modelines.html
56 * Local variables:
57 * c-basic-offset: 4
58 * tab-width: 8
59 * indent-tabs-mode: nil
60 * End:
62 * vi: set shiftwidth=4 tabstop=8 expandtab:
63 * :indentSize=4:tabSize=8:noTabs=true: