diff options
author | David Robillard <d@drobilla.net> | 2023-09-10 15:06:42 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | 248a874d7425749d29cf900a1c3783c624ea8d8c (patch) | |
tree | aed59f5a484a815cd254506866e98a947858904d /include/serd/env.h | |
parent | 0bd10132c6707353dba80bd89cf0102ee7ca4e34 (diff) | |
download | serd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.gz serd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.bz2 serd-248a874d7425749d29cf900a1c3783c624ea8d8c.zip |
Add support for custom allocators
This makes it explicit in the API where memory is allocated, and allows the
user to provide a custom allocator to avoid the use of the default system
allocator for whatever reason.
Diffstat (limited to 'include/serd/env.h')
-rw-r--r-- | include/serd/env.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/serd/env.h b/include/serd/env.h index b4f908a9..a0c47997 100644 --- a/include/serd/env.h +++ b/include/serd/env.h @@ -5,6 +5,7 @@ #define SERD_ENV_H #include "serd/attributes.h" +#include "serd/memory.h" #include "serd/node.h" #include "serd/sink.h" #include "serd/status.h" @@ -26,11 +27,12 @@ typedef struct SerdEnvImpl SerdEnv; /// Create a new environment SERD_API SerdEnv* ZIX_ALLOCATED -serd_env_new(SerdStringView base_uri); +serd_env_new(SerdAllocator* ZIX_NULLABLE allocator, SerdStringView base_uri); /// Copy an environment SERD_API SerdEnv* ZIX_ALLOCATED -serd_env_copy(const SerdEnv* ZIX_NULLABLE env); +serd_env_copy(SerdAllocator* ZIX_NULLABLE allocator, + const SerdEnv* ZIX_NULLABLE env); /// Return true iff `a` is equal to `b` SERD_PURE_API bool |