Skip to content

Commit

Permalink
Switch two allocations from ArrowMalloc to new to match later delete
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 16, 2023
1 parent 159253e commit 782b518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arrowio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@


ArrowSchema* schema_owning_ptr(void) {
struct ArrowSchema* schema = (struct ArrowSchema*)ArrowMalloc(sizeof(struct ArrowSchema));
struct ArrowSchema* schema = new struct ArrowSchema;
if (schema == nullptr) Rcpp::stop("Failed to allocate ArrowSchema");
schema->release = NULL;
spdl::debug("[schema_owning_ptr] created");
return schema;
}

ArrowArray* array_owning_ptr(void) {
struct ArrowArray* array = (struct ArrowArray*)ArrowMalloc(sizeof(struct ArrowArray));
struct ArrowArray* array = new struct ArrowArray;
if (array == nullptr) Rcpp::stop("Failed to allocate ArrowArray");
array->release = NULL;
spdl::debug("[array_owning_ptr] created");
Expand Down

0 comments on commit 782b518

Please sign in to comment.