summaryrefslogtreecommitdiffstats
path: root/itypes.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-08-27 07:09:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-08-27 07:09:14 -0700
commit502299dafb9307345bfb455f52997e1c9be6f12c (patch)
tree4062f207acea25f11612b5d0c98c5186204845fb /itypes.h
parentd990b667b33d853fcce6294364ae4232545742b0 (diff)
downloadtxr-502299dafb9307345bfb455f52997e1c9be6f12c.tar.gz
txr-502299dafb9307345bfb455f52997e1c9be6f12c.tar.bz2
txr-502299dafb9307345bfb455f52997e1c9be6f12c.zip
OOP: optimization in dupe base check.
Hypothesis: the majority of struct types will not be used as inheritance bases, and most of those that are bases will not be appear as duplicate bases. If we put a flag into a type which indicates that it has been used as a duplicate base, we can check that flag to do less work when initializing an object. * struct.c (struct struct_type): New flag, dupe. (get_duplicate_supers): Each time we find a duplicate supertype, we set its dupe flag. (make_struct_type): Allocate the struct type with chk_calloc instead of chk_malloc, so the flag is initialized to zero. Remove initializations of some members to zero: those of nslots, ntslots, stslot and spslot. (call_initfun_chain, call_postinitfun_chain): Don't bother search for st in the root's array of duplicates if st is not marked with the dupe flag.
Diffstat (limited to 'itypes.h')
0 files changed, 0 insertions, 0 deletions