diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-10-30 10:58:28 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-10-30 10:58:28 -0700 |
commit | e8873121aadbbb465c0c48da3c56b47a6a5f1d68 (patch) | |
tree | 9333fb01193d78f0f02050359f8acfeb7cfc672a /rbtree.h | |
parent | 9656a581cdb6f505c9adc6b5158b395c21b5c43a (diff) | |
download | nasm-e8873121aadbbb465c0c48da3c56b47a6a5f1d68.tar.gz nasm-e8873121aadbbb465c0c48da3c56b47a6a5f1d68.tar.bz2 nasm-e8873121aadbbb465c0c48da3c56b47a6a5f1d68.zip |
rbtree: drop the data pointer; instead rely on being embedded
Drop the data pointer, and instead assume the struct rbtree will be
embedded in a bigger data structure (to be extracted via
container_of()).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'rbtree.h')
-rw-r--r-- | rbtree.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4,15 +4,16 @@ #include "compiler.h" #include <inttypes.h> +/* This structure should be embedded in a larger data structure; + the final output from rb_search() can then be converted back + to the larger data structure via container_of(). */ struct rbtree { uint64_t key; - void *data; struct rbtree *left, *right; bool red; }; -struct rbtree *rb_insert(struct rbtree *, uint64_t, void *); +struct rbtree *rb_insert(struct rbtree *, struct rbtree *); const struct rbtree *rb_search(const struct rbtree *, uint64_t); -void rb_free(struct rbtree *); #endif /* NASM_RBTREE_H */ |