Files
bux-lang/stdlib/Std/Mem.bux
T
dimgigov 291de88506 docs: update README, Stdlib, BuildAndTest, PLAN for new std modules
Added documentation for:
- Std::Fs (DirExists, Mkdir, ListDir)
- Std::Mem (Alloc, Free, MemEq, New)
- Std::Set<T> (Set_New, Set_Add, Set_Has)
- String_Find, String_Replace, String_Format

Updated PLAN.md blockers (all resolved) and self-host status.
Updated README.md project structure and feature table.
Updated BuildAndTest.md with new stdlib modules and path syntax.

Also includes:
- CLI path argument fix (build/check/run accept project path)
- Remove dummyFunc from parser
- Fix String_Replace to use String_Concat instead of buggy str_join2
2026-06-02 18:46:03 +03:00

30 lines
601 B
Plaintext

module Std::Mem {
extern func bux_alloc(size: uint) -> *void;
extern func bux_realloc(ptr: *void, size: uint) -> *void;
extern func bux_free(ptr: *void);
extern func bux_mem_eq(a: *void, b: *void, size: uint) -> int;
func Alloc(size: uint) -> *void {
return bux_alloc(size);
}
func Realloc(ptr: *void, size: uint) -> *void {
return bux_realloc(ptr, size);
}
func Free(ptr: *void) {
bux_free(ptr);
}
func MemEq(a: *void, b: *void, size: uint) -> bool {
return bux_mem_eq(a, b, size) != 0;
}
func New<T>() -> *T {
let sz: uint = sizeof(T);
return bux_alloc(sz) as *T;
}
}