Skip to content

Commit

Permalink
malloc -> ArrowMalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Sep 11, 2024
1 parent eb43f12 commit adc7dad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/nanoarrow/common/inline_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <float.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "nanoarrow/common/inline_buffer.h"
Expand Down Expand Up @@ -513,13 +512,12 @@ static inline ArrowErrorCode ArrowArrayAppendBytes(struct ArrowArray* array,
if (n_vbufs == 0 ||
private_data->variadic_buffers[n_vbufs - 1].size_bytes + value.size_bytes >
NANOARROW_BINARY_VIEW_BLOCK_SIZE) {
// TODO: ArrowMalloc?
++n_vbufs;
// TODO: these should be realloc for > 0 case
private_data->variadic_buffers =
(struct ArrowBuffer*)malloc(sizeof(struct ArrowBuffer) * (n_vbufs));
(struct ArrowBuffer*)ArrowMalloc(sizeof(struct ArrowBuffer) * (n_vbufs));
private_data->variadic_buffer_sizes =
(int32_t*)malloc(sizeof(int32_t) * (n_vbufs));
(int32_t*)ArrowMalloc(sizeof(int32_t) * (n_vbufs));
ArrowBufferInit(&private_data->variadic_buffers[n_vbufs - 1]);
private_data->n_variadic_buffers = n_vbufs;
}
Expand Down

0 comments on commit adc7dad

Please sign in to comment.