Skip to content

[stb_ds] Added memory context support for custom allocators#1879

Open
nageshnnazare wants to merge 2 commits into
nothings:masterfrom
nageshnnazare:stb-ds-mem-context-support
Open

[stb_ds] Added memory context support for custom allocators#1879
nageshnnazare wants to merge 2 commits into
nothings:masterfrom
nageshnnazare:stb-ds-mem-context-support

Conversation

@nageshnnazare

Copy link
Copy Markdown
  • stb_ds.h supports custom allocation via STBDS_REALLOC / STBDS_FREE macros where context is by default NULL. This limits flexibility if we want to provide a context.
  • This feature allows to pass custom memory allocator context to array, hashmaps, and string hashmaps.
  • allocator pointer is stored in stbds_array_header
  • fully back-compatible with existing code
  • added testcase test_ds_mem_ctx.c to test new feature as well as backward compatibility.

Open for suggestions!

Added enhancement for custom allocator/free functions for array, hashmap
and string hashmap. Need to verify the functionality and also the back
compatibility.
Fixed some compilation issues, added test case to validate new support
as well fallback
@nothings

Copy link
Copy Markdown
Owner

see also #1623

@nageshnnazare

Copy link
Copy Markdown
Author

@nothings What do you recommend, on how to proceed ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants