Skip to content

Commit

Permalink
Merge branch 'macmason-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Krogius committed Sep 27, 2019
2 parents bca3a8d + 76a8442 commit 8fd1baf
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions common/zarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fd1baf

Please sign in to comment.