Skip to content

heap.alloc call hangs the function #2848

Open
@Sebight

Description

@Sebight

Bug description

Whenever calling the heap.alloc function, the whole function process stops -> possibly aborts.

export function allocate(size: i32): usize {
    logi(size);
    logi(memory.size());
    let ptr: usize = heap.alloc(size);
    logi(i32(ptr));
    return ptr;
}

It logs (back to my C++ host) the first 2 lines and then it stops. It does not call abort, so I have no idea what's up.

Am I doing something wrong? Thanks

Steps to reproduce

export function allocate(size: i32): usize {
    logi(size);
    logi(memory.size());
    let ptr: usize = heap.alloc(size);
    logi(i32(ptr));
    return ptr;
}

Try to allocate heap like so

AssemblyScript version

0.27.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions