mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 10:16:37 +00:00
Minor buddy alloc tweaks; Share entire allocator testing infrastructure
This commit is contained in:
@ -35,7 +35,8 @@ function runner(allocator, runs, allocs) {
|
||||
var base = allocator.allocate_memory(64);
|
||||
console.log("base: " + base);
|
||||
allocator.free_memory(base);
|
||||
console.log("mem initial: " + allocator.memory.buffer.byteLength);
|
||||
var currentMem = allocator.memory.buffer.byteLength;
|
||||
console.log("mem initial: " + currentMem);
|
||||
|
||||
try {
|
||||
for (var j = 0; j < runs; ++j) {
|
||||
@ -64,6 +65,10 @@ function runner(allocator, runs, allocs) {
|
||||
if (ptr !== base)
|
||||
throw Error("expected " + base + " but got " + ptr);
|
||||
allocator.free_memory(ptr);
|
||||
if (allocator.memory.buffer.byteLength > currentMem) {
|
||||
currentMem = allocator.memory.buffer.byteLength;
|
||||
console.log("mem changed: " + currentMem);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
// mem(allocator.memory, 0, 0x10000);
|
||||
|
Reference in New Issue
Block a user