stdlib beginnings (heap alloc)
This commit is contained in:
@@ -620,10 +620,13 @@
|
||||
byte slice when possible, and `[;0]u8` slices can decay to immutable `*c_char`/`?*c_char`
|
||||
parameters
|
||||
|
||||
25. dynamic heap allocation
|
||||
- see below for direction
|
||||
- notes below are too big in scope for a first pass and the language is not mature enough to support it yet
|
||||
- this first pass should focus on just basic heap allocation, so we have something to work with
|
||||
25. dynamic heap allocation (implemented; v1)
|
||||
- `std/mem/heap` is a tiny relative-importable package over libc `malloc`/`free`
|
||||
- `heap.alloc(size usize) ?*mut u8` returns nullable mutable byte memory; callers use existing optional unwraps
|
||||
- `heap.free(ptr ?*mut u8) void` forwards to C `free`, including `none` / null
|
||||
- typed allocation, allocator parameters, arenas/pools, build-mode heap policy, and escaping-allocation diagnostics remain deferred
|
||||
|
||||
26. comptime polymorphism (zig inspired)
|
||||
|
||||
## A word on multi-unwrap
|
||||
|
||||
|
||||
Reference in New Issue
Block a user