fix allocation issue
This commit is contained in:
parent
ebbdadb4b6
commit
fca125a0da
@ -198,7 +198,7 @@ abstract class ArenaObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
alloc(size: number) {
|
alloc(size: number) {
|
||||||
if (this.nativePtr !== undefined) {
|
if (this._nativePtr !== undefined) {
|
||||||
throw Error("Double allocation");
|
throw Error("Double allocation");
|
||||||
}
|
}
|
||||||
this.nativePtr = emscAlloc.malloc(size);
|
this.nativePtr = emscAlloc.malloc(size);
|
||||||
@ -440,7 +440,7 @@ abstract class PackedArenaObject extends ArenaObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
alloc() {
|
alloc() {
|
||||||
super.alloc(this.size());
|
// FIXME: should the client be allowed to call alloc multiple times?
|
||||||
if (!this._nativePtr) {
|
if (!this._nativePtr) {
|
||||||
this.nativePtr = emscAlloc.malloc(this.size());
|
this.nativePtr = emscAlloc.malloc(this.size());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user