Make an interface around gc.* fwiw

This commit is contained in:
dcodeIO
2018-07-19 16:15:56 +02:00
parent 34839353fd
commit fafaf423b4
13 changed files with 183 additions and 98 deletions

View File

@ -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();
}