diff options
author | David Robillard <d@drobilla.net> | 2021-09-14 17:19:12 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-09-14 17:19:12 -0400 |
commit | 19235b7127bcf5597fb0436deb45c2e6af5843c6 (patch) | |
tree | bb0207a4799f67933cd793e0501d09a10822c5ec /src/tree.c | |
parent | 9572ea596d07147dbfb6db7772623e740ce28652 (diff) | |
download | zix-19235b7127bcf5597fb0436deb45c2e6af5843c6.tar.gz zix-19235b7127bcf5597fb0436deb45c2e6af5843c6.tar.bz2 zix-19235b7127bcf5597fb0436deb45c2e6af5843c6.zip |
Make ZixAllocator a single flat struct
I can never decide between these two patterns for polymorphic objects in C, but
this one seems more appropriate here since it's more conducive to inheritance.
Diffstat (limited to 'src/tree.c')
-rw-r--r-- | src/tree.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -11,14 +11,14 @@ typedef struct ZixTreeNodeImpl ZixTreeNode; struct ZixTreeImpl { - const ZixAllocator* allocator; - ZixTreeNode* root; - ZixDestroyFunc destroy; - const void* destroy_user_data; - ZixComparator cmp; - void* cmp_data; - size_t size; - bool allow_duplicates; + ZixAllocator* allocator; + ZixTreeNode* root; + ZixDestroyFunc destroy; + const void* destroy_user_data; + ZixComparator cmp; + void* cmp_data; + size_t size; + bool allow_duplicates; }; struct ZixTreeNodeImpl { @@ -54,12 +54,12 @@ struct ZixTreeNodeImpl { #endif ZixTree* -zix_tree_new(const ZixAllocator* const allocator, - bool allow_duplicates, - ZixComparator cmp, - void* cmp_data, - ZixDestroyFunc destroy, - const void* destroy_user_data) +zix_tree_new(ZixAllocator* const allocator, + bool allow_duplicates, + ZixComparator cmp, + void* cmp_data, + ZixDestroyFunc destroy, + const void* destroy_user_data) { ZixTree* t = (ZixTree*)zix_malloc(allocator, sizeof(ZixTree)); |