unify mem/ref interface

This commit is contained in:
dcode
2019-03-27 17:21:52 +01:00
parent a3095478a3
commit e36722f2e6
66 changed files with 3501 additions and 3490 deletions

View File

@ -428,8 +428,8 @@ var ROOT: Root = changetype<Root>(0);
/** Allocates a chunk of memory. */
// @ts-ignore: decorator
@unsafe @global @inline
function __memory_allocate(size: usize): usize {
@unsafe @global
function __mem_allocate(size: usize): usize {
// initialize if necessary
var root = ROOT;
if (!root) {
@ -478,8 +478,8 @@ function __memory_allocate(size: usize): usize {
/** Frees the chunk of memory at the specified address. */
// @ts-ignore: decorator
@unsafe @global @inline
function __memory_free(data: usize): void {
@unsafe @global
function __mem_free(data: usize): void {
if (data) {
let root = ROOT;
if (root) {