Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
wmem_scopes.h File Reference
#include <wsutil/wmem/wmem.h>

Go to the source code of this file.

Functions

WS_DLL_PUBLIC wmem_allocator_twmem_epan_scope (void)
 Fetch the current epan scope.
 
WS_DLL_PUBLIC wmem_allocator_twmem_file_scope (void)
 Fetch the current file scope.
 
WS_DLL_LOCAL void wmem_enter_file_scope (void)
 Enters a file scope for memory management.
 
WS_DLL_LOCAL void wmem_leave_file_scope (void)
 Leave the file scope.
 
WS_DLL_PUBLIC void wmem_init_scopes (void)
 Initializes the memory scopes.
 
WS_DLL_PUBLIC void wmem_cleanup_scopes (void)
 Cleans up all memory scopes.
 

Detailed Description

Definitions for the Wireshark Memory Manager Scopes Copyright 2012, Evan Huus eapac.nosp@m.he@g.nosp@m.mail..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ wmem_cleanup_scopes()

WS_DLL_PUBLIC void wmem_cleanup_scopes ( void  )

Cleans up all memory scopes.

This function destroys the allocators for file_scope and epan_scope, cleans up any remaining memory allocations, and sets both scope pointers to NULL.

◆ wmem_enter_file_scope()

WS_DLL_LOCAL void wmem_enter_file_scope ( void  )

Enters a file scope for memory management.

This function marks the beginning of a new scope in which memory allocations are tracked and managed. It ensures that any memory allocated within this scope can be properly cleaned up when the scope is exited.

◆ wmem_epan_scope()

WS_DLL_PUBLIC wmem_allocator_t * wmem_epan_scope ( void  )

Fetch the current epan scope.

Allocated memory is freed when wmem_leave_epan_scope() is called, which is normally at program exit.

Returns
A pointer to the current epan scope allocator.

◆ wmem_file_scope()

WS_DLL_PUBLIC wmem_allocator_t * wmem_file_scope ( void  )

Fetch the current file scope.

Allocated memory is freed when wmem_leave_file_scope() is called, which is normally when a capture file is closed.

Returns
A pointer to the current file scope allocator.

◆ wmem_init_scopes()

WS_DLL_PUBLIC void wmem_init_scopes ( void  )

Initializes the memory scopes.

This function initializes the file scope and epan scope allocators.

◆ wmem_leave_file_scope()

WS_DLL_LOCAL void wmem_leave_file_scope ( void  )

Leave the file scope.

This function is used to leave the current file scope and clean up any resources associated with it.