Skip to content

Commit d9aa78e

Browse files
committed
fix: zpl_buffer_copy_init call
1 parent 97fc1bb commit d9aa78e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
19.0.4 - fix: zpl_buffer_copy_init missing macros (thanks Ed_ on Discord)
12
19.0.3 - fix: zpl_str_skip_literal reading before start of string (mbenniston)
23
19.0.2 - fixed ZPL_ISIZE_MIN and MAX for 32-bit architectures (mrossetti)
34
19.0.1 - Fixed zpl_array_fill ZPL_ASSERT off-by-one error

code/header/essentials/collections/buffer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ typedef struct zpl_buffer_header {
3333
#define zpl_buffer_count(x) (ZPL_BUFFER_HEADER(x)->count)
3434
#define zpl_buffer_capacity(x) (ZPL_BUFFER_HEADER(x)->capacity)
3535
#define zpl_buffer_end(x) (x + (zpl_buffer_count(x) - 1))
36+
#define zpl_buffer_allocator(x) (ZPL_BUFFER_HEADER(x)->backing)
3637

3738
#define zpl_buffer_init(x, allocator, cap) \
3839
do { \
@@ -60,7 +61,7 @@ do {
6061

6162
#define zpl_buffer_copy_init(y, x) \
6263
do { \
63-
zpl_buffer_init_reserve(y, zpl_buffer_allocator(x), zpl_buffer_capacity(x)); \
64+
zpl_buffer_init(y, zpl_buffer_allocator(x), zpl_buffer_capacity(x)); \
6465
zpl_memcopy(y, x, zpl_buffer_capacity(x) * zpl_size_of(*x)); \
6566
zpl_buffer_count(y) = zpl_buffer_count(x); \
6667
} while (0)

0 commit comments

Comments
 (0)