sq epan/dissectors/pidl/rcg/rcg.cnf
[wireshark-sm.git] / epan / wmem_scopes.h
blob6f4efee7b2ec8e6b9927b24e167d983e6c6192cc
1 /** @file
2 * Definitions for the Wireshark Memory Manager Scopes
3 * Copyright 2012, Evan Huus <eapache@gmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __WMEM_SCOPES_H__
13 #define __WMEM_SCOPES_H__
15 #include <wsutil/wmem/wmem.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /**
22 * @brief Fetch the current epan scope.
24 * Allocated memory is freed when wmem_leave_epan_scope() is called, which is normally at program exit.
26 WS_DLL_PUBLIC
27 wmem_allocator_t *
28 wmem_epan_scope(void);
30 /**
31 * @brief Fetch the current packet scope.
33 * Allocated memory is freed when wmem_leave_packet_scope() is called, which is normally at the end of packet dissection.
34 * N.B. Please use pinfo->pool in new code when possible. See
35 * <https://lists.wireshark.org/archives/wireshark-dev/202107/msg00052.html>
37 WS_DLL_PUBLIC
38 wmem_allocator_t *
39 wmem_packet_scope(void);
41 WS_DLL_LOCAL
42 void
43 wmem_enter_packet_scope(void);
45 WS_DLL_LOCAL
46 void
47 wmem_leave_packet_scope(void);
49 /**
50 * @brief Fetch the current file scope.
52 * Allocated memory is freed when wmem_leave_file_scope() is called, which is normally when a capture file is closed.
54 WS_DLL_PUBLIC
55 wmem_allocator_t *
56 wmem_file_scope(void);
58 WS_DLL_LOCAL
59 void
60 wmem_enter_file_scope(void);
62 WS_DLL_LOCAL
63 void
64 wmem_leave_file_scope(void);
66 /* Scope Management */
68 WS_DLL_PUBLIC
69 void
70 wmem_init_scopes(void);
72 WS_DLL_PUBLIC
73 void
74 wmem_cleanup_scopes(void);
76 #ifdef __cplusplus
78 #endif /* __cplusplus */
80 #endif /* __WMEM_SCOPES_H__ */
83 * Editor modelines - https://www.wireshark.org/tools/modelines.html
85 * Local variables:
86 * c-basic-offset: 4
87 * tab-width: 8
88 * indent-tabs-mode: nil
89 * End:
91 * vi: set shiftwidth=4 tabstop=8 expandtab:
92 * :indentSize=4:tabSize=8:noTabs=true: