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

Custom C allocator interface #4

Open
daniel-j-h opened this issue Jul 21, 2021 · 1 comment
Open

Custom C allocator interface #4

daniel-j-h opened this issue Jul 21, 2021 · 1 comment

Comments

@daniel-j-h
Copy link
Member

At the moment we use calloc / malloc / free for dynamic memory allocation.

We should allow for custom memory allocators.

Look into how to best support custom allocators.

@daniel-j-h
Copy link
Member Author

Here's how we could do this

  • have an allocator struct e.g. with free and malloc function pointers
  • have a static instance of this allocator struct in the c impl
  • have a function to change the instance's functions
  • have all code use the static (global) allocator struct

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

No branches or pull requests

1 participant