emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC, PATCH] shrink struct vectorlike_header #2


From: Paul Eggert
Subject: Re: [RFC, PATCH] shrink struct vectorlike_header #2
Date: Tue, 06 Nov 2012 12:53:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

> +struct large_vector
> +{
> +  union {
> +    struct large_vector *vector;
> +#if USE_LSB_TAG
> +    /* We need to maintain ROUNDUP_SIZE alignment for the vector member.  */
> +    unsigned char c[vroundup (sizeof (void *))];
> +#endif

That 'void *' should be 'struct large_vector *', mostly for readability
(but also for weird architectures where different pointer types have
different sizes).

> +/* Size of the struct buffer part beyond leading
> +   Lisp_Objects, in word_size units.  */
> +
> +#define BUFFER_REST_SIZE                                               \
> +  ((sizeof (struct buffer) - header_size) / word_size - BUFFER_LISP_SIZE)

This assumes (sizeof (struct buffer) - header_size) is a
multiple of word_size, but that's not necessarily the case.  Does it
matter that BUFFER_REST_SIZE might be incorrect?  If so, it needs to
be fixed; if not, there should be a comment explaining why it doesn't
matter whether the value is correct.

Otherwise, looks good; thanks.




reply via email to

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