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

@ -838,10 +838,10 @@ export class Program extends DiagnosticEmitter {
this.makeArrayInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
// memory allocator interface
if (element = this.lookupGlobal("__memory_allocate")) {
if (element = this.lookupGlobal("__mem_allocate")) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.allocateMem = this.resolver.resolveFunction(<FunctionPrototype>element, null);
element = assert(this.lookupGlobal("__memory_free"));
element = assert(this.lookupGlobal("__mem_free"));
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.freeMem = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}