MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_htable_stat

Function acl_htable_stat

lib_acl/src/stdlib/common/acl_htable.c:1187–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187void acl_htable_stat(const ACL_HTABLE *table)
1188{
1189 ACL_HTABLE_INFO *member;
1190 int i, count;
1191
1192 LOCK_TABLE_READ(table);
1193 printf("hash stat count for each key:\n");
1194 for(i = 0; i < table->size; i++) {
1195 count = 0;
1196 member = table->data[i];
1197 for(; member != 0; member = member->next) {
1198 count++;
1199 }
1200 if(count > 0) {
1201 printf("chains[%d]: count[%d]\n", i, count);
1202 }
1203 }
1204
1205 printf("hash stat all values for each key:\n");
1206 for(i = 0; i < table->size; i++) {
1207 member = table->data[i];
1208 if(member) {
1209 printf("chains[%d]: ", i);
1210 for(; member != 0; member = member->next) {
1211 printf("[%s]", member->key.c_key);
1212 }
1213 printf("\n");
1214 }
1215 }
1216 printf("hash table size=%d, used=%d\n", table->size, table->used);
1217 UNLOCK_TABLE(table);
1218}

Callers 4

test_htable_statFunction · 0.85
test_htable_rwlockFunction · 0.85
htable_iterFunction · 0.85
mainFunction · 0.85

Calls 2

LOCK_TABLE_READFunction · 0.85
UNLOCK_TABLEFunction · 0.85

Tested by 2

test_htable_statFunction · 0.68
test_htable_rwlockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…