diff options
Diffstat (limited to 'lib/unicode/string/u8upper.c')
-rw-r--r-- | lib/unicode/string/u8upper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/unicode/string/u8upper.c b/lib/unicode/string/u8upper.c index a77fcd8..ad10ef7 100644 --- a/lib/unicode/string/u8upper.c +++ b/lib/unicode/string/u8upper.c @@ -1,17 +1,16 @@ #include <errno.h> #include <stdckdint.h> +#include "alloc.h" #include "macros.h" #include "mbstring.h" #include "unicode/prop.h" #include "unicode/string.h" char8_t * -u8upper(size_t *dstn, u8view_t sv, enum caseflags flags, alloc_fn alloc, - void *alloc_ctx) +u8upper(size_t *dstn, u8view_t sv, caseflags_t flags, allocator_t mem) { ASSUME(dstn != nullptr); - ASSUME(alloc != nullptr); struct ucctx ctx = { .az_or_tr = flags & CF_LANG_AZ, @@ -25,7 +24,7 @@ u8upper(size_t *dstn, u8view_t sv, enum caseflags flags, alloc_fn alloc, return nullptr; } - char8_t *dst = alloc(alloc_ctx, nullptr, 0, bufsz, 1, alignof(char8_t)); + char8_t *dst = new(mem, typeof(*dst), bufsz); rune ch; size_t n = 0; @@ -43,5 +42,5 @@ u8upper(size_t *dstn, u8view_t sv, enum caseflags flags, alloc_fn alloc, } *dstn = n; - return alloc(alloc_ctx, dst, bufsz, n, 1, alignof(char8_t)); + return resz(mem, dst, bufsz, n); } |