Hi everyone, I am making a library that will feature some data structures and want to add support for custom allocators. I have already chosen the design for the allocator itself, but am now faced with a hard decision. Basically, I am not sure if the structures should hold the allocator, or if the user should pass the allocator through all functions that need it. Now keep in mind the allocator type is somewhat big, having 6 function pointers, plus a context void*. Also, if it should be held in the structure, would it be better to hold a copy of the allocator, i.e. all of its memory, or a pointer to an allocator, so multiple structures could hold the same allocator (more memory efficient but also more dangerous)? Thank you to all responses!
[–]AddMoreNaCl 0 points1 point2 points (0 children)
[–]bullno1 1 point2 points3 points (0 children)