3 * Definitions for the Wireshark Memory Manager Red-Black Tree
4 * Copyright 2013, Evan Huus <eapache@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __WMEM_TREE_INT_H__
14 #define __WMEM_TREE_INT_H__
16 #include "wmem_tree.h"
20 #endif /* __cplusplus */
22 typedef enum _wmem_node_color_t
{
28 struct _wmem_tree_node_t
{
29 struct _wmem_tree_node_t
*parent
;
30 struct _wmem_tree_node_t
*left
;
31 struct _wmem_tree_node_t
*right
;
36 wmem_node_color_t color
;
43 typedef struct _wmem_tree_node_t wmem_tree_node_t
;
46 typedef struct _wmem_itree_node_t wmem_itree_node_t
;
49 wmem_allocator_t
*metadata_allocator
;
50 wmem_allocator_t
*data_allocator
;
51 wmem_tree_node_t
*root
;
52 unsigned metadata_scope_cb_id
;
53 unsigned data_scope_cb_id
;
55 void (*post_rotation_cb
)(wmem_tree_node_t
*);
58 typedef int (*compare_func
)(const void *a
, const void *b
);
61 wmem_tree_insert_node(wmem_tree_t
*tree
, const void *key
, void *data
, compare_func cmp
);
63 typedef struct _wmem_range_t wmem_range_t
;
66 wmem_itree_range_overlap(const wmem_range_t
*r1
, const wmem_range_t
*r2
);
70 #endif /* __cplusplus */
72 #endif /* __WMEM_TREE__INTERNALS_H__ */
75 * Editor modelines - https://www.wireshark.org/tools/modelines.html
80 * indent-tabs-mode: nil
83 * vi: set shiftwidth=4 tabstop=8 expandtab:
84 * :indentSize=4:tabSize=8:noTabs=true: