mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 19:21:47 +00:00
rt hooks all over the place
still some work to do on optimizing away retain/release calls, but this looks promising
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
export { __alloc, __realloc, __free } from "./tlsf";
|
||||
export { __retain, __release, __collect } from "./purerc";
|
||||
export { __instanceof, __typeinfo } from "./common";
|
||||
export { __alloc, __realloc, __free } from "rt/tlsf";
|
||||
export { __retain, __release, __collect } from "rt/purerc";
|
||||
export { __instanceof, __typeinfo } from "rt/common";
|
||||
|
@ -154,7 +154,7 @@ function growRoots(): void {
|
||||
var oldRoots = ROOTS;
|
||||
var oldSize = CUR - oldRoots;
|
||||
var newSize = max(oldSize * 2, 64 << alignof<usize>());
|
||||
var newRoots = memory.allocate(newSize);
|
||||
var newRoots = __alloc(newSize, 0);
|
||||
memory.copy(newRoots, oldRoots, oldSize);
|
||||
ROOTS = newRoots;
|
||||
CUR = newRoots + oldSize;
|
||||
|
@ -476,8 +476,8 @@ export function allocateBlock(root: Root, size: usize): Block {
|
||||
if (DEBUG) assert(block); // must be found now
|
||||
}
|
||||
if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit
|
||||
block.gcInfo = 0;
|
||||
block.rtId = 0; // not determined yet
|
||||
block.gcInfo = 1; // RC=1
|
||||
// block.rtId = 0; // set by the caller (__alloc)
|
||||
block.rtSize = size;
|
||||
removeBlock(root, <Block>block);
|
||||
prepareBlock(root, <Block>block, payloadSize);
|
||||
|
Reference in New Issue
Block a user