emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109131: Return more descriptive


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109131: Return more descriptive data from Fgarbage_collect.
Date: Wed, 18 Jul 2012 06:46:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>> (strings SIZE USED FREE)
>> and
>> (string-bytes 1 USED FREE)

> IIUC, FREE is always between 0 and SBLOCK_BYTES after compacting sblocks,
> so I don't see too much sense here.

That's fine: use (string-bytes 1 USED) then.  The important part is to
use the same form for all entries.

An alternative is to define the format of entries to be not
(NAME SIZE USED FREE) but
(NAME SIZE USED FREE SLOTS-SIZE SLOTS-USED SLOTS-FREE)

where all entries except for strings and vectors will have nil in the
last 3 positions (and (nil nil nil) can be represented more compactly by
just nil).

> IMHO counting vector slots is poor idea because:
>  1) vectors are of different length, so, having just a number of vector
>     slots, we don't know how much of struct vectorlike_header we have
>     (and they eats memory too);

Just like for strings (tho for slightly different reasons), we want to
have `vectors' and `vector-slots', yes.

>  2) this doesn't count extra space beyond Lisp_Objects in pseudovectors
>     and doesn't count space used by bool vectors.

AFAIK these pseudo-vectors have sizes which are (pretty much always)
a multiple of slots, so we can still count them as "slots" even if some
of those bytes aren't Lisp_Object fields.


        Stefan



reply via email to

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