MCPcopy Create free account
hub / github.com/USCiLab/cereal / SetArrayRaw

Function SetArrayRaw

include/cereal/external/rapidjson/document.h:2041–2051  ·  view source on GitHub ↗

Initialize this value as array with initial data, without calling destructor.

Source from the content-addressed store, hash-verified

2039
2040 // Initialize this value as array with initial data, without calling destructor.
2041 void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) {
2042 data_.f.flags = kArrayFlag;
2043 if (count) {
2044 GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
2045 SetElementsPointer(e);
2046 std::memcpy(static_cast<void*>(e), values, count * sizeof(GenericValue));
2047 }
2048 else
2049 SetElementsPointer(0);
2050 data_.a.size = data_.a.capacity = count;
2051 }
2052
2053 //! Initialize this value as object with initial data, without calling destructor.
2054 void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {

Callers

nothing calls this directly

Calls 2

SetElementsPointerFunction · 0.85
MallocMethod · 0.45

Tested by

no test coverage detected