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

Provide VirtualStack implementation #6

Open
Dominaezzz opened this issue Apr 12, 2019 · 3 comments
Open

Provide VirtualStack implementation #6

Dominaezzz opened this issue Apr 12, 2019 · 3 comments

Comments

@Dominaezzz
Copy link
Owner

On native platforms there's a com.kgl.utils.VirtualStack used for allocations for temporaries when interacting with C. At the moment it just forwards allocations to nativeHeap which is not ideal.
Ideally VirtualStack should create a large chunk of memory (about 64KB) to be re-used for function calls.

@nlbuescher
Copy link
Collaborator

What was the reason for writing a custom VirtualStack implementation rather than using Native's Arena class and/or memScoped function?

@Dominaezzz
Copy link
Owner Author

The last time I checked, the native arena and memScoped call some sort of malloc, possibly a wrapper around the real malloc. It would be much better if small objects like Int and Long didn't require malloc each time. Might as well recycle a single allocation.

@nlbuescher
Copy link
Collaborator

That seems to still be the case. Thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants