-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmodule.ae
More file actions
36 lines (29 loc) · 982 Bytes
/
Copy pathmodule.ae
File metadata and controls
36 lines (29 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// std.alloc (#1045): swappable allocator convention. See docs/allocators.md.
exports(
system, of_arena, arena_free,
raw, resize, release
)
extern aether_allocator_system() -> ptr
extern aether_allocator_arena(arena: ptr) -> ptr
extern aether_allocator_arena_destroy(a: ptr)
extern aether_allocator_alloc(a: ptr, size: int) -> ptr
extern aether_allocator_realloc(a: ptr, block: ptr, old_size: int, new_size: int) -> ptr
extern aether_allocator_free(a: ptr, block: ptr, size: int)
system() -> ptr {
return aether_allocator_system()
}
of_arena(arena: ptr) -> ptr {
return aether_allocator_arena(arena)
}
arena_free(a: ptr) {
aether_allocator_arena_destroy(a)
}
raw(a: ptr, size: int) -> ptr {
return aether_allocator_alloc(a, size)
}
resize(a: ptr, block: ptr, old_size: int, new_size: int) -> ptr {
return aether_allocator_realloc(a, block, old_size, new_size)
}
release(a: ptr, block: ptr, size: int) {
aether_allocator_free(a, block, size)
}