mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 01:41:30 +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:
@ -87,7 +87,7 @@ function weakHeapSort<T>(
|
||||
const shift32 = alignof<u32>();
|
||||
|
||||
var bitsetSize = (length + 31) >> 5 << shift32;
|
||||
var bitset = memory.allocate(bitsetSize); // indexed in 32-bit chunks below
|
||||
var bitset = __alloc(bitsetSize, 0); // indexed in 32-bit chunks below
|
||||
memory.fill(bitset, 0, bitsetSize);
|
||||
|
||||
// see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf
|
||||
@ -133,7 +133,7 @@ function weakHeapSort<T>(
|
||||
}
|
||||
}
|
||||
|
||||
memory.free(bitset);
|
||||
__free(bitset);
|
||||
|
||||
var t: T = load<T>(dataStart, sizeof<T>()); // t = arr[1]
|
||||
store<T>(dataStart, load<T>(dataStart), sizeof<T>()); // arr[1] = arr[0]
|
||||
|
Reference in New Issue
Block a user