MCPcopy Create free account
hub / github.com/CytopiaTeam/Cytopia / CreateBuffer

Method CreateBuffer

external/as_add_on/scriptarray/scriptarray.cpp:918–935  ·  view source on GitHub ↗

internal

Source from the content-addressed store, hash-verified

916
917// internal
918void CScriptArray::CreateBuffer(SArrayBuffer **buf, asUINT numElements)
919{
920 *buf = reinterpret_cast<SArrayBuffer*>(userAlloc(sizeof(SArrayBuffer)-1+elementSize*numElements));
921
922 if( *buf )
923 {
924 (*buf)->numElements = numElements;
925 (*buf)->maxElements = numElements;
926 Construct(*buf, 0, numElements);
927 }
928 else
929 {
930 // Oops, out of memory
931 asIScriptContext *ctx = asGetActiveContext();
932 if( ctx )
933 ctx->SetException("Out of memory");
934 }
935}
936
937// internal
938void CScriptArray::DeleteBuffer(SArrayBuffer *buf)

Callers

nothing calls this directly

Calls 1

ConstructFunction · 0.50

Tested by

no test coverage detected