unsafe, stub

This commit is contained in:
dcode
2019-03-10 21:38:15 +01:00
parent 5a2ab3d7ec
commit cb77760562
19 changed files with 824 additions and 819 deletions

View File

@ -11,12 +11,14 @@
declare function _malloc(size: usize): usize;
declare function _free(ptr: usize): void;
// Memory allocator interface
// Memory allocator implementation
@global namespace memory {
@global export function __memory_allocate(size: usize): usize {
return _malloc(size);
}
@inline export function allocate(size: usize): usize {
return _malloc(size);
}
@global export function __memory_free(ptr: usize): void {
_free(ptr);
@inline export function free(ptr: usize): void {
_free(ptr);
}
}