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

Method scanPointer

src/simulate/json_scan.cpp:433–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431 // ---- scan pointer (struct pointer) ----
432
433 bool scanPointer(char * dst, TypeInfo * ti) {
434 if (isNull()) {
435 *(char**)dst = nullptr;
436 return true;
437 }
438 if (ti->firstType && ti->firstType->type == Type::tStructure && ti->firstType->structType) {
439 auto si = ti->firstType->structType;
440 char * ptr = ctx.allocate(si->size, at);
441 if (!ptr) return false;
442 memset(ptr, 0, si->size);
443 if (!scanStruct(ptr, si)) return false;
444 *(char**)dst = ptr;
445 return true;
446 }
447 // unsupported pointer type — skip
448 return skipValue();
449 }
450
451 // ---- scan dynamic array ----
452

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected