guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gc-live-object-stats on numbers


From: Kevin Ryde
Subject: gc-live-object-stats on numbers
Date: Thu, 16 Aug 2007 09:49:13 +1000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

gc-live-object-stats returns big, real and complex numbers only as "tag
23" (which is scm_tc7_number).  I'm looking at the following to fix
that, and also get separate counts of each type.

        * gc-card.c (scm_i_card_statistics): Record scm_tc7_number types as
        tc16 values so big, real, complex and fraction can be distinguished.

        (scm_i_tag_name): Return "number" for scm_tc7_number, not NULL.  NULL
        was making numbers come out as "type 23" in gc-live-object-stats.
        Fix tests of the tc16 number types, they were checked under
        scm_tc7_number, but the values went down the tag>=255 smob case.
        Put smob case under scm_tc7_smob instead of using tag>=255, per
        recommendation in comments with scm_tc7_smob to use symbolic values. 
        Use SCM_TC2SMOBNUM to extract scm_smobs index, instead of explicit
        code.  Lose some unnecessary "break" statements.

And at the same time slip in a slight speedup

        (scm_i_card_statistics): Use scm_hashq_create_handle_x and modify the
        element returned, rather than two lookups scm_hashq_ref and
        scm_hashq_set_x.

Attachment: gc-card.c.num-stats.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]