mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 12:11:50 +00:00
Update binaryen to latest nightly; Source map support
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
// A simple arena allocator that provides a `clear_memory` function to reset
|
||||
// the heap to its initial state. A user has to make sure that there are no
|
||||
// more references to cleared memory afterwards. Always aligns to 8 bytes.
|
||||
/////////////// A simple yet effective Arena Memory Allocator /////////////////
|
||||
|
||||
// Provides a `reset_memory` function to reset the heap to its initial state. A
|
||||
// user has to make sure that there are no more references to cleared memory
|
||||
// afterwards. Always aligns to 8 bytes.
|
||||
|
||||
const ALIGN_LOG2: usize = 3;
|
||||
const ALIGN_SIZE: usize = 1 << ALIGN_LOG2;
|
||||
@ -27,6 +29,6 @@ export function free_memory(ptr: usize): void {
|
||||
// nop
|
||||
}
|
||||
|
||||
export function clear_memory(): void {
|
||||
export function reset_memory(): void {
|
||||
HEAP_OFFSET = HEAP_BASE;
|
||||
}
|
10
std/assembly/allocator/tlsf.ts
Normal file
10
std/assembly/allocator/tlsf.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// Re-export for now, so there's just one source file being worked on
|
||||
|
||||
export {
|
||||
allocate_memory,
|
||||
free_memory
|
||||
} from "../../../examples/tlsf/assembly/tlsf";
|
||||
|
||||
export function reset_memory(): void {
|
||||
throw new Error("not supported");
|
||||
}
|
Reference in New Issue
Block a user