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>
19 #endif /* __cplusplus */
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.
28 wmem_epan_scope(void);
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>
39 wmem_packet_scope(void);
43 wmem_enter_packet_scope(void);
47 wmem_leave_packet_scope(void);
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.
56 wmem_file_scope(void);
60 wmem_enter_file_scope(void);
64 wmem_leave_file_scope(void);
66 /* Scope Management */
70 wmem_init_scopes(void);
74 wmem_cleanup_scopes(void);
78 #endif /* __cplusplus */
80 #endif /* __WMEM_SCOPES_H__ */
83 * Editor modelines - https://www.wireshark.org/tools/modelines.html
88 * indent-tabs-mode: nil
91 * vi: set shiftwidth=4 tabstop=8 expandtab:
92 * :indentSize=4:tabSize=8:noTabs=true: