;development helpers (define (dg-debug-log-ids a) (b0 dg-ids-t*) (while a (debug-log "%lu" (dg-ids-first a)) (set a (dg-ids-rest a)))) (define (dg-debug-log-ids-set a) (b0 imht-set-t) (define index b32 0) (while (< index a.size) (debug-log "%lu" (deref a.content index)) (set index (+ 1 index)))) (define (dg-debug-display-relation-records records) (b0 dg-relation-records-t*) (define record dg-relation-record-t) (printf "relation records\n") (while records (set record (dg-relation-records-first records)) (printf " lcor %lu %lu %lu %lu\n" (struct-get record left) (struct-get record label) (struct-get record ordinal) (struct-get record right)) (set records (dg-relation-records-rest records)))) (define (dg-debug-count-all-btree-entries txn result) (status-t MDB-txn* b32*) status-init (define stat dg-statistics-t) (status-require! (dg-statistics txn (address-of stat))) (set (deref result) (+ (struct-get stat id->data ms_entries) (struct-get stat data-intern->id ms_entries) (struct-get stat data-extern->extern ms_entries) (struct-get stat left->right ms_entries) (struct-get stat right->left ms_entries) (struct-get stat label->left ms_entries))) (label exit (return status))) (define (dg-debug-display-btree-counts txn) (status-t MDB-txn*) status-init (define stat dg-statistics-t) (status-require! (dg-statistics txn (address-of stat))) (printf "btree entry count\n id->data %d data-intern->id %d\n data-extern->extern %d left->right %d\n right->left %d label->left %d\n" (struct-get stat id->data ms_entries) (struct-get stat data-intern->id ms_entries) (struct-get stat data-extern->extern ms_entries) (struct-get stat left->right ms_entries) (struct-get stat right->left ms_entries) (struct-get stat label->left ms_entries)) (label exit (return status)))