c-blake/bst
View on GitHub ↗ ★ 6 C
Well Factored, Non-Recursive, General & Generic BSTs in ANSI C
7 mentions on Hacker News by 1 person: 0 stories, 7 comments · first 2021-11-12 · latest 2025-06-27
20082026
-
…by "flipping the script" and defining whole files "parameterized" by their macro environment like https://github.com/c-blake/bst or https://github.com/glouw/ctl/ Add a namespacing macro and you have a whole generics system, unlike that in…
comment by cb321 · 2025-06-27 · in Parameterized types in C using the new tag compatibility rule -
…I've said it myself), one reason I like the design of a little "workload interpreter shell" as in https://github.com/c-blake/bst/blob/main/test/bst-interact.c (or maybe better https://github.com/c-blake/adix/blob/master/tests/btshell.ni...…
comment by cb321 · 2025-01-09 · in Writing a simple pool allocator in C -
…for example, if you are willing to limit yourself to 64 KiNodes of equal sized objects, a pool like https://github.com/c-blake/bst/blob/main/POOL.c can use an unsigned short 2-byte pointer. This small address space specialization can give…
comment by cb321 · 2025-01-09 · in Writing a simple pool allocator in C -
…pp-based "CTL"-like C templating idea or abstract ways of dealing with the BST zoo) interesting: https://github.com/c-blake/bst/blob/main/test/bst-interact.c Essentially, you just write a very simple (some might say trivial) interactive…
comment by cb321 · 2024-12-09 · in Show HN: A portable hash map in C -
…(AVL, red-black, etc.) operations, you can indeed cover a lot of bases as elaborated here: https://github.com/c-blake/bst (including also how you handle duplicate keys as well as the perhaps less useful neither-ranked-nor-keyed access,…
comment by cb321 · 2024-05-22 · in Counted B-Trees (2017) -
If you like this article then you might also be interested in: https://github.com/c-blake/bst It's ANSI C with a bespoke macro generics system not Go, does not cover as many balancing rules, and is not written up as nicely. It does do…
comment by cb321 · 2023-08-17 · in Exploring the design space of binary search trees -
…is to use void*/dynamic dispatch, this is not necessary. E.g., https://github.com/glouw/ctl/ or https://github.com/c-blake/bst show a couple ways to have generic code statically specialized in regular old C. (Instantiation/specialization…
comment by cb321 · 2021-11-12 · in The Rust compiler has gotten faster again