summaryrefslogtreecommitdiffstats
path: root/src/alloc.c
Commit message (Collapse)AuthorAgeFilesLines
* sanity: New sanitize_resize() functionTavian Barnes7 days1-16/+15
| | | | | This wraps __sanitizer_annotate_contiguous_container() to give byte-precise tracking of usable allocation sizes with ASan.
* sanity: Get rid of sanitize_ignore()Tavian Barnes7 days1-2/+2
| | | | | It's probably nicer to avoid evaluating expensive arguments when not sanitizing, rather than relying on the optimizer to clean them up.
* sanity: Don't mark memory uninit in sanitize_{alloc,free}()Tavian Barnes2024-11-021-2/+4
| | | | | We might want to change the size of an allocated region without changing which bytes are initialized.
* alloc: Stop supporting pathological flexible array ABIsTavian Barnes2024-11-021-3/+3
|
* alloc: Don't require size % align == 0Tavian Barnes2024-11-021-10/+5
| | | | | | | | | Allowing unaligned sizes will allow us to allocate aligned slabs with additional metadata in the tail without ballooning the allocation size for large alignments. Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2244.htm#dr_460 Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2072.htm
* Fix spellingTavian Barnes2024-09-231-1/+1
|
* 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
|
* prelude: Simplify attributesTavian Barnes2024-07-281-1/+1
|
* config: Check for aligned_alloc()Tavian Barnes2024-04-191-3/+3
|
* Rename config.h to prelude.hTavian Barnes2024-04-191-1/+1
|
* config: New variadic attr(...) macroTavian Barnes2023-12-181-1/+1
|
* alloc: New helpers for growing dynamic arraysTavian Barnes2023-11-231-22/+44
|
* alloc: New helpers for aligned reallocationTavian Barnes2023-11-231-4/+38
| | | | | | There is no aligned_realloc(), so the new xrealloc() function emulates it by manually reallocating and copying for over-aligned types. The new REALLOC_ARRAY() and REALLOC_FLEX() macros wrap xrealloc().
* alloc: New ALLOC_MAX macroTavian Barnes2023-11-231-2/+10
|
* alloc: New is_aligned() helperTavian Barnes2023-11-231-5/+5
|
* Initial support for Cosmopolitan LibcTavian Barnes2023-11-101-0/+1
|
* config: New attr_noinline and attr_cold macrosTavian Barnes2023-11-091-0/+1
|
* alloc: New varena_grow() functionTavian Barnes2023-08-311-0/+15
|
* alloc: New [v]arena_clear() functionsTavian Barnes2023-08-311-1/+15
|
* alloc: Use a different error code for size overflowsTavian Barnes2023-07-131-0/+10
| | | | This should help debuggability, and also squelches a GCC warning.
* alloc: Implement an arena for flexible structsTavian Barnes2023-06-201-0/+118
|
* alloc: Implement an arena allocatorTavian Barnes2023-06-201-0/+111
|
* alloc: New header for memory allocation utilitiesTavian Barnes2023-06-201-0/+50