all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Emacs development discussions <emacs-devel@gnu.org>
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	[thread overview]
Message-ID: <jwvipdl2vzr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <500683FB.6000509@yandex.ru> (Dmitry Antipov's message of "Wed, 18 Jul 2012 13:38:03 +0400")

>> (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	other threads:[~2012-07-18 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1SrNZW-0003vA-5g@vcs.savannah.gnu.org>
2012-07-18  6:33 ` [Emacs-diffs] /srv/bzr/emacs/trunk r109131: Return more descriptive data from Fgarbage_collect Stefan Monnier
2012-07-18  9:38   ` Dmitry Antipov
2012-07-18 10:46     ` Stefan Monnier [this message]
2012-07-18 12:46       ` Dmitry Antipov
2012-07-19  7:55         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvipdl2vzr.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.