Closed paolostivanin closed 6 days ago
The alloc funcs are only using when allocating and deallocating memory. They are stored as function pointers in global variables. Your use case is fine as long as the specific function doesn't e.g. try to free a json structure that was created with the previous alloc functions.
Hello, at the program startup, I set the following custom alloc funcs:
in some other part of my program I would need to use other alloc funcs (without secure memory). Would it be OK to call again
json_set_alloc_funcs
or could this screw things up for stuff that's still in memory using the previous call?Example:
json_set_alloc_funcs (gcry_malloc_secure, gcry_free);
json_set_alloc_funcs (g_malloc0, g_free);
json_set_alloc_funcs (gcry_malloc_secure, gcry_free);
is called againWhat do you think?
Thanks!