-
Notifications
You must be signed in to change notification settings - Fork 911
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
Adding Arena Allocator? #4434
Comments
I don't see how an arena allocator can possibly be used safely in Go. Go is a garbage collected language, so if any outside objects have a pointer to an object inside the arena that will become a dangling pointer after freeing the arena. I can't prevent anybody from shooting themselves in the foot, but I don't think this is something we're going to add to TinyGo to be honest. A better solution in my opinion would be to improve the GC itself. For example, I've been working on adding the (very well tuned) Boehm GC to TinyGo: #4385 |
@aykevl What about support of explicit (feel free to close the issue in any case, thanks) |
Can you describe your use case? |
Mainly WASM binaries for web server custom filters. ref: https://github.com/tetratelabs/proxy-wasm-go-sdk According to the above project, one of major issues is GC in WASM. |
Hmm, okay. I have seen that comment, but I haven't experienced those issues myself. GC is a known issue in WebAssembly because WebAssembly doesn't allow scanning the stack so it's always going to be less efficient. I hope to make it at least a bit more efficient with bdwgc. Or, maybe, it will be possible in the future to use the built-in WebAssembly GC (which is currently entirely unsupported in LLVM so right now is impossible to implement). |
Yea I understand that issue is basically on WASM side, this will be an issue for all languages that use GC in some way, Kotlin native probably has similar issues with WASM and GC. |
Adding a first-class support for memory arenas could possibly benefit in avoiding some of GC issues especially present in WASM.
The text was updated successfully, but these errors were encountered: