MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / getVariantSize

Function getVariantSize

src/simulate/debug_info.cpp:274–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272 }
273
274 static int getVariantSize ( TypeInfo * info ) {
275 int maxSize = 0;
276 int al = getVariantAlign(info) - 1;
277 for ( uint32_t i=0, is=info->argCount; i!=is; ++i ) {
278 int size = (getTypeBaseSize(Type::tInt) + al) & ~al;
279 size += getTypeSize(info->argTypes[i]);
280 maxSize = das::max(size, maxSize);
281 }
282 maxSize = (maxSize + al) & ~al;
283 return maxSize;
284 }
285
286 int getVariantFieldOffset ( TypeInfo * info, int index ) {
287 DAS_ASSERT(info->type==Type::tVariant);

Callers 1

getTypeBaseSizeFunction · 0.85

Calls 3

getVariantAlignFunction · 0.85
getTypeBaseSizeFunction · 0.85
getTypeSizeFunction · 0.85

Tested by

no test coverage detected