diff options
author | Richard Braun <rbraun@sceen.net> | 2017-01-26 00:41:07 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-01-26 00:41:07 +0100 |
commit | 900d78f86a2a6684a956f95163898814eb54d9ea (patch) | |
tree | 445937ac20493639c10b5d01f0b7d6080d1eb7af /rdxtree.h | |
parent | bd875458fcb4aa5516996ffb128b601a89bd25af (diff) |
rdxtree: make key allocation optional
Diffstat (limited to 'rdxtree.h')
-rw-r--r-- | rdxtree.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Richard Braun. + * Copyright (c) 2011-2017 Richard Braun. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,11 @@ typedef uint64_t rdxtree_key_t; #endif /* RDXTREE_KEY_32 */ /* + * Radix tree initialization flags. + */ +#define RDXTREE_KEY_ALLOC 0x1 /* Enable key allocation */ + +/* * Radix tree. */ struct rdxtree; @@ -72,9 +77,12 @@ struct rdxtree_iter; * Initialize a tree. */ static inline void -rdxtree_init(struct rdxtree *tree) +rdxtree_init(struct rdxtree *tree, unsigned short flags) { + assert((flags & ~RDXTREE_KEY_ALLOC) == 0); + tree->height = 0; + tree->flags = flags; tree->root = NULL; } |