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

Method walk_table

src/simulate/simulate_gc.cpp:131–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 virtual void walk_table ( Table * tab, TypeInfo * info ) override {
132 if ( !canVisitTableData(info) ) return;
133 int keySize = info->firstType->size;
134 int valueSize = info->secondType->size;
135 if (info->firstType->flags & gcFlags) {
136 if (info->secondType->flags & gcFlags) {
137 for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) {
138 if ( tableLiveSlot(*tab, i) ) {
139 // key
140 char * key = tab->keys + i*keySize;
141 walk ( key, info->firstType );
142 // value
143 char * value = tab->data + i*valueSize;
144 walk ( value, info->secondType );
145 }
146 }
147 } else {
148 for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) {
149 if ( tableLiveSlot(*tab, i) ) {
150 // key
151 char * key = tab->keys + i*keySize;
152 walk ( key, info->firstType );
153 }
154 }
155 }
156 } else {
157 for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) {
158 if ( tableLiveSlot(*tab, i) ) {
159 // value
160 char * value = tab->data + i*valueSize;
161 walk ( value, info->secondType );
162 }
163 }
164 }
165 }
166
167 using DataWalker::walk;
168

Callers

nothing calls this directly

Calls 3

canVisitTableDataFunction · 0.85
tableLiveSlotFunction · 0.85
walkFunction · 0.85

Tested by

no test coverage detected