mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 10:41:42 +00:00
Update dependencies and move ts-node to prod for now
This commit is contained in:
@ -475,13 +475,15 @@ export function allocate_memory(size: usize): usize {
|
||||
|
||||
/** Frees the chunk of memory at the specified address. */
|
||||
export function free_memory(data: usize): void {
|
||||
var root = ROOT;
|
||||
if (root && data) {
|
||||
var block = changetype<Block>(data - Block.INFO);
|
||||
var blockInfo = block.info;
|
||||
assert(!(blockInfo & FREE)); // must be used
|
||||
block.info = blockInfo | FREE;
|
||||
root.insert(changetype<Block>(data - Block.INFO));
|
||||
if (data) {
|
||||
var root = ROOT;
|
||||
if (root) {
|
||||
var block = changetype<Block>(data - Block.INFO);
|
||||
var blockInfo = block.info;
|
||||
assert(!(blockInfo & FREE)); // must be used
|
||||
block.info = blockInfo | FREE;
|
||||
root.insert(changetype<Block>(data - Block.INFO));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user