summaryrefslogtreecommitdiffstats
path: root/src/trie.c
Commit message (Collapse)AuthorAgeFilesLines
* alloc: Don't require the old size in varena_realloc()Tavian Barnes2024-11-021-8/+7
| | | | Instead, just look up which arena contains the pointer.
* trie: Fix varena_free() with wrong sizeTavian Barnes2024-11-021-8/+8
| | | | | | | In trie_remove(), clearing the bit before trie_node_collapse() causes us to free the old node with size 1 instead of 2, putting it on the wrong freelist. This is technically safe with the current arena implementation, but not intentional.
* trie: Switch the tag bits aroundTavian Barnes2024-10-081-31/+28
| | | | | | First of all, almost all checks were !trie_is_leaf(), so it makes sense to use trie_is_node() instead. Secondly, using the tag bit for internal nodes allows us to remove some NULL checks.
* trie: Add some extra bounds checkingTavian Barnes2024-10-081-13/+24
|
* build: Move feature test macros to prelude.hTavian Barnes2024-08-281-1/+0
| | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented.
* prelude: Split bfs-specific utilities into new bfs.h headerTavian Barnes2024-08-281-0/+3
|
* diag: Get rid of bfs_static_assert()Tavian Barnes2024-08-281-1/+1
| | | | | In most cases, it's not too annoying to specify a message. For tests/bit.c, we can manually polyfill the 1-argument version.
* prelude: Simplify attributesTavian Barnes2024-07-281-9/+9
|
* trie: Don't pass a bitfield directly to has_single_bit()Tavian Barnes2024-05-301-1/+1
|
* trie: Add some more target_clones wrappersTavian Barnes2024-05-201-2/+12
|
* Rename config.h to prelude.hTavian Barnes2024-04-191-1/+1
|
* trie: Calculate representative indices branchlesslyTavian Barnes2024-03-231-3/+4
|
* Re-run include-what-you-useTavian Barnes2024-03-111-2/+0
|
* config: New variadic attr(...) macroTavian Barnes2023-12-181-1/+1
|
* config: New attr_target_clones() macroTavian Barnes2023-11-091-8/+8
|
* list: Assert that we're not inserting already-attached nodesTavian Barnes2023-10-121-0/+1
|
* Formatting fixesTavian Barnes2023-09-271-1/+1
|
* trie: New trie_clear() functionTavian Barnes2023-08-311-0/+8
|
* Unify macro naming conventionsTavian Barnes2023-06-241-1/+1
| | | | | In particular, macros that decide whether to use a particular API/ dependency should be spelled BFS_USE_*, and should be configurable.
* trie: Arena-allocate nodes and leavesTavian Barnes2023-06-201-34/+31
|
* alloc: New header for memory allocation utilitiesTavian Barnes2023-06-201-4/+3
|
* Switch from assert() to bfs_assert()/bfs_verify()Tavian Barnes2023-05-181-17/+16
|
* trie: Use SIZE_WIDTHTavian Barnes2023-05-181-6/+6
|
* bit: Rename int.h to bit.hTavian Barnes2023-05-181-1/+1
|
* trie: Use standard bit utilitiesTavian Barnes2023-05-161-44/+15
|
* trie: Use ENDIAN_* and bswap()Tavian Barnes2023-05-161-7/+3
|
* trie: Use the _WIDTH macrosTavian Barnes2023-05-161-5/+6
|
* trie: Use bfs_static_assert()Tavian Barnes2023-05-161-1/+2
|
* config: Provide <stdalign.h> and <stdbool.h>Tavian Barnes2023-05-111-1/+0
| | | | In anticipation of C23, since those headers won't be necessary any more.
* config: s/BFS_FLEX_SIZEOF/flex_sizeof/Tavian Barnes2023-05-101-2/+2
|
* style: Don't use tabs to indent preprocessor directivesTavian Barnes2023-05-031-15/+15
|
* list: Use macros instead of type-erased listsTavian Barnes2023-03-311-4/+4
|
* trie: Use list.h for the list of leavesTavian Barnes2023-03-291-24/+4
|
* Replace license boilerplate with SPDX tagsTavian Barnes2023-01-251-15/+2
| | | | | | | And while I'm at it, remove years from copyright declarations. Link: https://spdx.dev/about/ Link: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/
* trie: Use static_assert() instead of #errorTavian Barnes2022-12-071-3/+1
|
* config: Support target_clones on more platformsTavian Barnes2022-11-211-1/+1
|
* trie: Limit target_clones to glibcTavian Barnes2022-11-161-5/+5
| | | | Musl doesn't support ifuncs.
* trie: Check __has_attribute(target_clones) before using itTavian Barnes2022-11-091-1/+1
|
* config: Split out some of util.h into a new headerTavian Barnes2022-11-061-1/+1
|
* trie: Optimize trie_mismatch() with tzcntTavian Barnes2022-11-011-13/+40
|
* trie: Use target_clones() for popcntTavian Barnes2022-10-301-6/+28
|
* trie: Refactor insertion to allocate the leaf in one placeTavian Barnes2022-10-301-49/+48
|
* trie: Make leaves into a linked listTavian Barnes2022-10-291-20/+49
|
* trie: New is_power_of_two() helperTavian Barnes2022-10-291-5/+10
|
* trie: Convert ASCII art to Unicode artTavian Barnes2022-10-291-31/+49
|
* Source / Include Folder (#88)トトも2022-04-161-0/+693
Moved Source Files Into `src` Folder