Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heap.alloc call hangs the function #2848

Open
Sebight opened this issue May 28, 2024 · 0 comments
Open

heap.alloc call hangs the function #2848

Sebight opened this issue May 28, 2024 · 0 comments
Labels

Comments

@Sebight
Copy link

Sebight commented May 28, 2024

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

@Sebight Sebight added the bug label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant