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

Method beforeLambda

src/simulate/bin_serializer.cpp:271–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269 }
270 }
271 virtual void beforeLambda ( Lambda * lambda, TypeInfo * ) override {
272 TypeInfo * info = nullptr;
273 if ( reading ) {
274 uint64_t hash = 0;
275 serialize(hash);
276 info = context->debugInfo->lookup[hash]; // TODO: verify if there is capture, all that
277 DAS_ASSERTF(info,"type info not found. how did we get type, which is not in the typeinfo hash?");
278 uint32_t size = getTypeSize(info) + 16;
279 char * ptr = context->allocate(size);
280 context->heap->mark_comment(ptr, "lambda (via bin serializer)");
281 memset ( ptr, 0, size );
282 *((TypeInfo **)ptr) = info;
283 ptr += 16;
284 lambda->capture = ptr;
285 } else {
286 info = lambda->getTypeInfo();
287 serialize(info->hash);
288 }
289 }
290 };
291
292 // save ( obj, block<(bytesAt)> )

Callers

nothing calls this directly

Calls 4

getTypeSizeFunction · 0.85
getTypeInfoMethod · 0.80
serializeFunction · 0.50
allocateMethod · 0.45

Tested by

no test coverage detected