diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-05-21 17:49:32 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-05-21 17:49:32 +0200 |
| commit | 6d7aef62de3dd6a5900816b002bf9304d763e052 (patch) | |
| tree | 60b41bef2cbfbfcabff2062466584a0f76f475b8 /src | |
| parent | 8240eff87bb928e12a093cc37aae78576cdf4f6c (diff) | |
| download | libstrvec-c-6d7aef62de3dd6a5900816b002bf9304d763e052.tar.gz libstrvec-c-6d7aef62de3dd6a5900816b002bf9304d763e052.zip | |
Update liballoc
Diffstat (limited to 'src')
| -rw-r--r-- | src/strvec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/strvec.c b/src/strvec.c index bf8b95c..7073edf 100644 --- a/src/strvec.c +++ b/src/strvec.c @@ -40,13 +40,13 @@ strvec_alloc(size_t cap, struct allocator *allocator, int *_rc) rc = _rc ? _rc : &stub; - strvec = allocator->alloc(sizeof(struct strvec), rc); + strvec = allocator->alloc(allocator, sizeof(struct strvec), rc); if (!strvec && _rc) *rc = -*rc; if (!strvec) return NULL; *rc = strvec_init(strvec, cap, allocator); if (*rc) { - allocator->free(strvec); + allocator->free(allocator, strvec); return NULL; } @@ -67,7 +67,7 @@ strvec_free(struct strvec *strvec) LIBSTRVEC_ABORT_ON_ALLOC(rc < 0); if (rc) return rc; - rc = allocator->free(strvec); + rc = allocator->free(allocator, strvec); LIBSTRVEC_ABORT_ON_ALLOC(rc); if (rc) return -rc; @@ -88,7 +88,7 @@ strvec_copy(struct strvec *dst, struct strvec *src, for (DVEC_ITER(&dst->vec, str)) { if (!*str) continue; len = strlen(*str); - nstr = allocator->alloc(len + 1, &rc); + nstr = allocator->alloc(allocator, len + 1, &rc); LIBSTRVEC_ABORT_ON_ALLOC(!nstr); if (!nstr) return rc; strncpy(nstr, *str, len + 1); |
