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-21 13:35:27 +0200
commita1d9e124ecbc42f411e1807091f95aaa94ef1198 (patch)
tree4ebff294a437a8102ca09b42a9f450322d13eb1b /serd
parent7e10a58373dbbb850c4f4daeb90ce2d9739da441 (diff)
downloadserd-a1d9e124ecbc42f411e1807091f95aaa94ef1198.tar.gz
serd-a1d9e124ecbc42f411e1807091f95aaa94ef1198.tar.bz2
serd-a1d9e124ecbc42f411e1807091f95aaa94ef1198.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*