mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 04:31:43 +00:00
Make an interface around gc.* fwiw
This commit is contained in:
@ -10,17 +10,12 @@
|
||||
declare function malloc(size: usize): usize;
|
||||
declare function free(ptr: usize): void;
|
||||
|
||||
@global
|
||||
export function __memory_allocate(size: usize): usize {
|
||||
// Memory allocator interface
|
||||
|
||||
@global export function __memory_allocate(size: usize): usize {
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
@global
|
||||
export function __memory_free(ptr: usize): void {
|
||||
@global export function __memory_free(ptr: usize): void {
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
@global
|
||||
export function __memory_reset(): void {
|
||||
unreachable();
|
||||
}
|
||||
|
Reference in New Issue
Block a user