Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
wmem_allocator.h
1 /* wmem_allocator.h
2  * Definitions for the Wireshark Memory Manager Allocator
3  * Copyright 2012, Evan Huus <eapache@gmail.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __WMEM_ALLOCATOR_H__
13 #define __WMEM_ALLOCATOR_H__
14 
15 #include <glib.h>
16 #include <string.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
23 
24 /* See section "4. Internal Design" of doc/README.wmem for details
25  * on this structure */
27  /* Consumer functions */
28  void *(*walloc)(void *private_data, const size_t size);
29  void (*wfree)(void *private_data, void *ptr);
30  void *(*wrealloc)(void *private_data, void *ptr, const size_t size);
31 
32  /* Producer/Manager functions */
33  void (*free_all)(void *private_data);
34  void (*gc)(void *private_data);
35  void (*cleanup)(void *private_data);
36 
37  /* Callback List */
38  struct _wmem_user_cb_container_t *callbacks;
39 
40  /* Implementation details */
41  void *private_data;
42  enum _wmem_allocator_type_t type;
43  gboolean in_scope;
44 };
45 
46 #ifdef __cplusplus
47 }
48 #endif /* __cplusplus */
49 
50 #endif /* __WMEM_ALLOCATOR_H__ */
51 
52 /*
53  * Editor modelines - http://www.wireshark.org/tools/modelines.html
54  *
55  * Local variables:
56  * c-basic-offset: 4
57  * tab-width: 8
58  * indent-tabs-mode: nil
59  * End:
60  *
61  * vi: set shiftwidth=4 tabstop=8 expandtab:
62  * :indentSize=4:tabSize=8:noTabs=true:
63  */
Definition: wmem_allocator.h:26
_wmem_allocator_type_t
Definition: wmem_core.h:44
Definition: wmem_user_cb.c:18