aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-06 16:05:42 -0500
committerDavid Robillard <d@drobilla.net>2018-07-22 12:47:44 +0200
commit2fddc28b430ede69e44dcd69e3692993a7c1d161 (patch)
tree309fa87c7fb0adb5ea4b1e049a58ed9d1a40efc3 /serd
parent88ac6c757f5a40a604c14775cf11552fa657f0ad (diff)
downloadserd-2fddc28b430ede69e44dcd69e3692993a7c1d161.tar.gz
serd-2fddc28b430ede69e44dcd69e3692993a7c1d161.tar.bz2
serd-2fddc28b430ede69e44dcd69e3692993a7c1d161.zip
Add serd_free for freeing memory allocated by serd
Diffstat (limited to 'serd')
-rw-r--r--serd/serd.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/serd/serd.h b/serd/serd.h
index f3d83515..49a516fa 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -275,6 +275,17 @@ typedef enum {
} SerdStyle;
/**
+ Free memory allocated by Serd.
+
+ This function exists because some systems require memory allocated by a
+ library to be freed by code in the same library. It is otherwise equivalent
+ to the standard C free() function.
+*/
+SERD_API
+void
+serd_free(void* ptr);
+
+/**
@name String Utilities
@{
*/
@@ -316,7 +327,7 @@ serd_strtod(const char* str, char** endptr);
@param str Base64 string to decode.
@param len The length of `str`.
@param size Set to the size of the returned blob in bytes.
- @return A newly allocated blob which must be freed with free().
+ @return A newly allocated blob which must be freed with serd_free().
*/
SERD_API
void*
@@ -386,7 +397,7 @@ serd_uri_to_path(const uint8_t* uri);
@param hostname If non-NULL, set to the hostname, if present.
@return The path component of the URI.
- The returned path and `*hostname` must be freed with free().
+ The returned path and `*hostname` must be freed with serd_free().
*/
SERD_API
uint8_t*