diff options
| author | Baitinq <[email protected]> | 2025-06-11 00:16:17 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-06-11 00:16:17 +0200 |
| commit | fa92a157746ae17f295d31b7a047dfeb99624a13 (patch) | |
| tree | 71e469e67a70df15542d873ebe223654def6111b /std/mem.src | |
| parent | stdlib: Remove println (diff) | |
| download | pry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.tar.gz pry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.tar.bz2 pry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.zip | |
Misc: Rename lang
Diffstat (limited to 'std/mem.src')
| -rw-r--r-- | std/mem.src | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/std/mem.src b/std/mem.src deleted file mode 100644 index 3bb1a0a..0000000 --- a/std/mem.src +++ /dev/null @@ -1,29 +0,0 @@ -extern calloc = (i64, i64) => *void; -extern realloc = (*void, i64) => *void; -extern free = (*void) => void; - -import "!stdlib.src"; - -let arena = struct { - buf: *void, - offset: i64, -}; - -let arena_init = (size: i64) => *arena { - let a = cast(*arena, calloc(1, sizeof(arena))); - (*a).buf = calloc(1, size); - (*a).offset = 0; - return a; -}; - -let arena_free = (a: *arena) => void { - free((*a).buf); - free(cast(*void, a)); - return; -}; - -let arena_alloc = (a: *arena, size: i64) => *void { - let old_offset = (*a).offset; - (*a).offset = (*a).offset + size; - return cast(*void, cast(*i8, (*a).buf) + cast(*i8, old_offset)); -}; |