mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-27 05:31:56 +00:00
Implement function types / indirect calls / trampolines (#39)
This commit is contained in:
@ -61,7 +61,7 @@ const MIN_ALLOC: usize = 1 << MIN_ALLOC_LOG2;
|
||||
* heaps will have multiple allocations, so the real maximum allocation limit
|
||||
* is at most 1gb.
|
||||
*/
|
||||
const MAX_ALLOC_LOG2: usize = 31;
|
||||
const MAX_ALLOC_LOG2: usize = 30; // 31;
|
||||
const MAX_ALLOC: usize = 1 << MAX_ALLOC_LOG2;
|
||||
|
||||
/*
|
||||
@ -338,7 +338,7 @@ function lower_bucket_limit(bucket: usize): u32 {
|
||||
}
|
||||
|
||||
@global
|
||||
function allocate_memory(request: usize): usize {
|
||||
export function allocate_memory(request: usize): usize {
|
||||
var original_bucket: usize, bucket: usize;
|
||||
|
||||
/*
|
||||
@ -475,7 +475,7 @@ function allocate_memory(request: usize): usize {
|
||||
}
|
||||
|
||||
@global
|
||||
function free_memory(ptr: usize): void {
|
||||
export function free_memory(ptr: usize): void {
|
||||
var bucket: usize, i: usize;
|
||||
|
||||
/*
|
||||
@ -539,3 +539,8 @@ function free_memory(ptr: usize): void {
|
||||
*/
|
||||
list_push(buckets$get(bucket), changetype<List>(ptr_for_node(i, bucket)));
|
||||
}
|
||||
|
||||
@global
|
||||
export function reset_memory(): void {
|
||||
unreachable();
|
||||
}
|
||||
|
Reference in New Issue
Block a user