add realloc (and update c_allocator)

This commit is contained in:
2026-07-11 13:42:55 +02:00
parent 90869dcb4d
commit 6dd6b7ff54
6 changed files with 122 additions and 5 deletions
+1 -2
View File
@@ -72,8 +72,7 @@ roadmap and milestone history.
### standard packages
- `std/mem` allocator contract over byte allocation: `Allocator` with `?*mut anyopaque` context, `heap`, `alloc(allocator, size, alignment) ?*mut u8`, and `free(allocator, ptr, size, alignment)`
- `std/mem/heap` legacy compatibility wrappers: `alloc(size usize) ?*mut u8` and `free(ptr ?*mut u8)`
- `std/mem` allocator contract over byte allocation: `Allocator` with `?*mut anyopaque` context plus `alloc`, `realloc`, and `free`; failed nonzero reallocation preserves the original allocation, while zero size frees it
### compiler behavior