[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] mem_node shrink
From: |
Richard Stallman |
Subject: |
Re: [patch] mem_node shrink |
Date: |
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 ();