aboutsummaryrefslogtreecommitdiffstats
path: root/src/caret.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-19 17:55:02 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit0f9816d67bc67a396607291f845ca2a33c2285a7 (patch)
treeb31fd1b344305dc984a2109084fa183573a0ae43 /src/caret.c
parent258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff)
downloadserd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip
Use ZixAllocator directly
Diffstat (limited to 'src/caret.c')
-rw-r--r--src/caret.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/caret.c b/src/caret.c
index 2d7e9a8e..e7ff58fa 100644
--- a/src/caret.c
+++ b/src/caret.c
@@ -3,10 +3,8 @@
#include "caret.h"
-#include "memory.h"
-
#include "serd/caret.h"
-#include "serd/memory.h"
+#include "zix/allocator.h"
#include <assert.h>
#include <stdbool.h>
@@ -14,15 +12,14 @@
#include <string.h>
SerdCaret*
-serd_caret_new(SerdAllocator* const allocator,
+serd_caret_new(ZixAllocator* const allocator,
const SerdNode* const document,
const unsigned line,
const unsigned column)
{
assert(document);
- SerdCaret* const caret =
- (SerdCaret*)serd_amalloc(allocator, sizeof(SerdCaret));
+ SerdCaret* const caret = (SerdCaret*)zix_malloc(allocator, sizeof(SerdCaret));
if (caret) {
caret->document = document;
@@ -34,14 +31,13 @@ serd_caret_new(SerdAllocator* const allocator,
}
SerdCaret*
-serd_caret_copy(SerdAllocator* const allocator, const SerdCaret* const caret)
+serd_caret_copy(ZixAllocator* const allocator, const SerdCaret* const caret)
{
if (!caret) {
return NULL;
}
- SerdCaret* const copy =
- (SerdCaret*)serd_amalloc(allocator, sizeof(SerdCaret));
+ SerdCaret* const copy = (SerdCaret*)zix_malloc(allocator, sizeof(SerdCaret));
if (copy) {
memcpy(copy, caret, sizeof(SerdCaret));
@@ -51,9 +47,9 @@ serd_caret_copy(SerdAllocator* const allocator, const SerdCaret* const caret)
}
void
-serd_caret_free(SerdAllocator* const allocator, SerdCaret* const caret)
+serd_caret_free(ZixAllocator* const allocator, SerdCaret* const caret)
{
- serd_afree(allocator, caret);
+ zix_free(allocator, caret);
}
bool