MCPcopy Create free account
hub / github.com/WheretIB/nullc / ConstructVector

Function ConstructVector

NULLC/includes/vector.cpp:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#pragma pack(pop)
23
24 void ConstructVector(vector* vec, unsigned int type, int reserved)
25 {
26 vec->elemType = type;
27 vec->flags = nullcIsPointer(type);
28 vec->size = 0;
29 vec->elemSize = nullcGetTypeSize(type);
30 vec->data.typeID = type;
31 if(reserved)
32 {
33 vec->data.ptr = (char*)nullcAllocate(vec->elemSize * reserved);
34 vec->data.len = reserved;
35 }else{
36 vec->data.ptr = NULL;
37 vec->data.len = 0;
38 }
39 }
40
41 void VectorPushBack(NULLCRef val, vector* vec)
42 {

Callers

nothing calls this directly

Calls 3

nullcIsPointerFunction · 0.85
nullcAllocateFunction · 0.85
nullcGetTypeSizeFunction · 0.70

Tested by

no test coverage detected