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

idea: port pool(2) #654

Open
ec1oud opened this issue Jun 7, 2024 · 2 comments
Open

idea: port pool(2) #654

ec1oud opened this issue Jun 7, 2024 · 2 comments

Comments

@ec1oud
Copy link

ec1oud commented Jun 7, 2024

On Plan 9, malloc() uses poolalloc(). I suppose plan9port just uses the underlying platform malloc() right? But I think memory pools are useful in other scenarios, for example to confine certain data types to specific memory blocks. So I'm trying to make the code portable to posix platforms. My goal is to do arena allocation exactly the same on all OSes and all platforms (at least on little-endian 64-bit architectures). I'm not sure how achievable that is; so far I just got it to compile, and already ended up with differences in behavior somehow, which I'm trying to troubleshoot. I just wondered if someone else has thought of it or tried it, or maybe someone knows of a better solution?

@frobnitzem
Copy link

frobnitzem commented Jun 27, 2024

Would jemalloc provide a useful backend? Perhaps YAKL's pool allocator?

@ec1oud
Copy link
Author

ec1oud commented Jun 28, 2024

Actually I got poolalloc() working well enough for my purposes so far, and figured I'd keep using it rather than something else, because I try to write portable software and poolalloc() is already there on Plan 9.

But I wouldn't be surprised if some newer implementation could be more efficient.

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