2 * Wireshark Memory Manager Stack
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
16 #include "wmem_core.h"
17 #include "wmem_stack.h"
18 #include "wmem_list.h"
20 /* Wmem stack is implemented as a simple wrapper over Wmem list */
23 wmem_stack_peek(const wmem_stack_t
*stack
)
25 wmem_list_frame_t
*frame
;
27 frame
= wmem_list_head(stack
);
31 return wmem_list_frame_data(frame
);
35 wmem_stack_pop(wmem_stack_t
*stack
)
39 data
= wmem_stack_peek(stack
);
41 wmem_list_remove(stack
, data
);
47 * Editor modelines - https://www.wireshark.org/tools/modelines.html
52 * indent-tabs-mode: nil
55 * vi: set shiftwidth=4 tabstop=8 expandtab:
56 * :indentSize=4:tabSize=8:noTabs=true: