mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 19:51:47 +00:00
Make an interface around gc.* fwiw
This commit is contained in:
@ -11,17 +11,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