From 76a844273dc5b73d15a2bb7b56d67a3a3c6e9ba2 Mon Sep 17 00:00:00 2001 From: Max Krogius Date: Fri, 27 Sep 2019 15:36:40 -0400 Subject: [PATCH] Remove zarray_copy_data entirely. --- common/zarray.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/common/zarray.h b/common/zarray.h index 47978746..1a882c28 100644 --- a/common/zarray.h +++ b/common/zarray.h @@ -226,26 +226,6 @@ inline static void zarray_truncate(zarray_t *za, int sz) za->size = sz; } -/** - * Copies the memory array used internally by zarray to store its owned - * elements to the address pointed by 'buffer'. It is the caller's responsibility - * to allocate zarray_size()*el_sz bytes for the copy to be stored and - * to free the memory when no longer needed. The memory allocated at 'buffer' - * and the internal zarray storage must not overlap. 'buffer_bytes' should be - * the size of the 'buffer' memory space, in bytes, and must be at least - * zarray_size()*el_sz. - * - * Returns the number of bytes copied into 'buffer'. - */ -static inline size_t zarray_copy_data(const zarray_t *za, void *buffer, size_t buffer_bytes) -{ - assert(za != NULL); - assert(buffer != NULL); - assert(buffer_bytes >= za->el_sz * za->size); - memcpy(buffer, za->data, za->el_sz * za->size); - return za->el_sz * za->size; -} - /** * Removes the entry at index 'idx'. * If shuffle is true, the last element in the array will be placed in