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

Method walk_table

src/simulate/simulate_gc.cpp:598–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596 }
597
598 virtual void walk_table ( Table * tab, TypeInfo * info ) override {
599 if ( !canVisitTableData(info) ) return;
600 int keySize = info->firstType->size;
601 int valueSize = info->secondType->size;
602 uint64_t count = 0;
603 for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) {
604 if ( tableLiveSlot(*tab, i) ) {
605 bool last = (count == (tab->size-1));
606 // key
607 char * key = tab->keys + i*keySize;
608 beforeTableKey(tab, info, key, info->firstType, count, last);
609 walk ( key, info->firstType );
610 afterTableKey(tab, info, key, info->firstType, count, last);
611 // value
612 char * value = tab->data + i*valueSize;
613 beforeTableValue(tab, info, value, info->secondType, count, last);
614 walk ( value, info->secondType );
615 afterTableValue(tab, info, value, info->secondType, count, last);
616 // next
617 count ++;
618 }
619 }
620 }
621
622 virtual void beforeIterator ( Iterator * iter ) override {
623 char * ptr = ((char *) iter) - 16;

Callers

nothing calls this directly

Calls 7

canVisitTableDataFunction · 0.85
tableLiveSlotFunction · 0.85
beforeTableKeyFunction · 0.85
walkFunction · 0.85
afterTableKeyFunction · 0.85
beforeTableValueFunction · 0.85
afterTableValueFunction · 0.85

Tested by

no test coverage detected