unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: Dmitry Antipov <dmantipov@yandex.ru>, emacs-devel@gnu.org
Subject: Re: [patch] mem_node shrink
Date: Fri, 23 Nov 2007 09:55:17 -0500	[thread overview]
Message-ID: <jwvzlx56mhi.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1IvQG1-0007Gd-74@fencepost.gnu.org> (Richard Stallman's message of "Thu, 22 Nov 2007 23:35:13 -0500")

>> So I think MOST_POSITIVE_FIXNUM should be replaced with something
>> guaranteed to be right.  Define a constant to serve as the width of
>> that field, and use the same constant here in something like -((-1) <<
>> MEM_NODE_SIZE_WIDTH).

>     If GC_MALLOC_CHECK is defined, xmalloc and xrealloc calls
>     mem_insert.  On 64-bit system, if neither USE_MMAP_FOR_BUFFERS nor
>     REL_ALLOC are used, xmalloc and xrealloc may grow buffer text up
>     to the size which fits into integer, but not into 28-bit bitfield.
>     So, the bitfield should be wide enough, i.e. have width
>     BITS_PER_EMACS_INT - 4.

> There are two questions here.  You're talking about whether the field
> is wide enough.  The other is how to write this error check:

>> +  if (size > MOST_POSITIVE_FIXNUM)
>> +    abort ();

Yes.  A simpler test is to read the size we just wrote in the object's
field and check it reads out as the same value.


        Stefan

  reply	other threads:[~2007-11-23 14:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 10:43 [patch] mem_node shrink Dmitry Antipov
2007-11-22  2:26 ` Richard Stallman
2007-11-22 13:57   ` Dmitry Antipov
2007-11-23  4:35     ` Richard Stallman
2007-11-23 14:55       ` Stefan Monnier [this message]
2007-11-22  3:42 ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvzlx56mhi.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).