MCPcopy Create free account
hub / github.com/apache/cloudberry / array_copy

Function array_copy

src/backend/utils/adt/arrayfuncs.c:4825–4836  ·  view source on GitHub ↗

* Copy nitems array elements from srcptr to destptr * * destptr: starting destination location (must be enough room!) * nitems: number of array elements to copy (>= 0) * srcptr: starting location in source array * offset: 0-based linear element number of first element (the one at *srcptr) * nullbitmap: start of source array's null bitmap, or NULL if none * typlen, typbyval, typalign: storag

Source from the content-addressed store, hash-verified

4823 * NB: this does not take care of setting up the destination's null bitmap!
4824 */
4825static int
4826array_copy(char *destptr, int nitems,
4827 char *srcptr, int offset, bits8 *nullbitmap,
4828 int typlen, bool typbyval, char typalign)
4829{
4830 int numbytes;
4831
4832 numbytes = array_nelems_size(srcptr, offset, nullbitmap, nitems,
4833 typlen, typbyval, typalign);
4834 memcpy(destptr, srcptr, numbytes);
4835 return numbytes;
4836}
4837
4838/*
4839 * Copy nitems null-bitmap bits from source to destination

Callers 2

array_extract_sliceFunction · 0.85
array_insert_sliceFunction · 0.85

Calls 1

array_nelems_sizeFunction · 0.85

Tested by

no test coverage detected