1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 17:03:43 +02:00

removed malloc.h

This commit is contained in:
Anthony Scemama 2021-05-12 23:57:40 +02:00
parent e65fa310d3
commit b7a0f608c8

View File

@ -125,8 +125,8 @@ void* qmckl_malloc(qmckl_context context, const qmckl_memory_info_struct info) {
/* If qmckl_memory_struct is full, reallocate a larger one */ /* If qmckl_memory_struct is full, reallocate a larger one */
if (ctx->memory.n_allocated == ctx->memory.array_size) { if (ctx->memory.n_allocated == ctx->memory.array_size) {
const size_t old_size = ctx->memory.array_size; const size_t old_size = ctx->memory.array_size;
qmckl_memory_info_struct * new_array = reallocarray(ctx->memory.element, qmckl_memory_info_struct * new_array = realloc(ctx->memory.element,
2L * old_size, 2L * old_size *
sizeof(qmckl_memory_info_struct)); sizeof(qmckl_memory_info_struct));
if (new_array == NULL) { if (new_array == NULL) {
qmckl_unlock(context); qmckl_unlock(context);