File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -730,7 +730,26 @@ void gc_dump_alloc_table(void) {
730730 #endif
731731 else if (* ptr == (mp_uint_t )& mp_type_fun_bc ) { c = 'B' ; }
732732 else if (* ptr == (mp_uint_t )& mp_type_module ) { c = 'M' ; }
733- else { c = 'h' ; }
733+ else {
734+ c = 'h' ;
735+ #if 0
736+ // This code prints "Q" for qstr-pool data, and "q" for qstr-str
737+ // data. It can be useful to see how qstrs are being allocated,
738+ // but is disabled by default because it is very slow.
739+ for (qstr_pool_t * pool = MP_STATE_VM (last_pool ); c == 'h' && pool != NULL ; pool = pool -> prev ) {
740+ if ((qstr_pool_t * )ptr == pool ) {
741+ c = 'Q' ;
742+ break ;
743+ }
744+ for (const byte * * q = pool -> qstrs , * * q_top = pool -> qstrs + pool -> len ; q < q_top ; q ++ ) {
745+ if ((const byte * )ptr == * q ) {
746+ c = 'q' ;
747+ break ;
748+ }
749+ }
750+ }
751+ #endif
752+ }
734753 break ;
735754 }
736755 case AT_TAIL : c = 't' ; break ;
You can’t perform that action at this time.
0 commit comments