enhance toml_set_memutil to assign default
This commit is contained in:
parent
1901ac3166
commit
2e8feafae8
1 changed files with 4 additions and 4 deletions
8
toml.c
8
toml.c
|
@ -46,10 +46,10 @@ void toml_set_memutil(void* (*xxmalloc)(size_t),
|
|||
void* (*xxcalloc)(size_t, size_t),
|
||||
void* (*xxrealloc)(void*, size_t))
|
||||
{
|
||||
ppmalloc = xxmalloc;
|
||||
ppfree = xxfree;
|
||||
ppcalloc = xxcalloc;
|
||||
pprealloc = xxrealloc;
|
||||
if (xxmalloc) ppmalloc = xxmalloc;
|
||||
if (xxfree) ppfree = xxfree;
|
||||
if (xxcalloc) ppcalloc = xxcalloc;
|
||||
if (xxrealloc) pprealloc = xxrealloc;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue