emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r117464: Shrink Lisp_Sub_Char_Table by preferrin


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r117464: Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects.
Date: Thu, 03 Jul 2014 15:52:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> -  int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 
>> 0);
>> +  int i;
>> +  Lisp_Object *contents
>> +    = pvectype == PVEC_SUB_CHAR_TABLE
>> +    ? (size -= SUB_CHAR_TABLE_OFFSET,
>> +       ((struct Lisp_Sub_Char_Table *)ptr)->contents)
>> +    : ((struct Lisp_Char_Table *)ptr)->contents;

> This is obviously wrong because Lisp_Object slots of Lisp_Char_Table
> between 'header' and 'contents' are never marked.

The patch was just meant to show the intention.  I didn't try to make
it correct.

>   Lisp_Object *contents
>     = pvectype == PVEC_SUB_CHAR_TABLE
>     ? (size -= SUB_CHAR_TABLE_OFFSET,
>        ((struct Lisp_Sub_Char_Table *)ptr)->contents)
>     : ptr->contents;


> And, IIUC, 'size -= SUB_CHAR_TABLE_OFFSET' still assumes that
> SUB_CHAR_TABLE_OFFSET is a multiple of sizeof (Lisp_Object)
> (otherwise subtracting it from size, which is a number of
> Lisp_Object slots, makes no sense).

No, SUB_CHAR_TABLE_OFFSET is not supposed to be a multiple of anything,
neither in my proposal nor in the current code.


        Stefan



reply via email to

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