[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: immediate strings #2
From: |
Dmitry Antipov |
Subject: |
Re: immediate strings #2 |
Date: |
Tue, 29 Nov 2011 07:37:16 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 |
Hm, this is still 40 bytes on 64-bit (and so 20 on 32-bit):
struct Lisp_String
{
INTERVAL intervals;
union {
struct {
unsigned gcmarkbit : 1;
unsigned immbit : 1;
EMACS_INT size : 7;
EMACS_INT size_byte : 7;
unsigned char data[STRING_IMM_MAX];
} imm;
struct {
unsigned unused : 2;
EMACS_INT size : BITS_PER_EMACS_INT - 1;
EMACS_INT size_byte : BITS_PER_EMACS_INT - 1;
unsigned char *data;
} dat;
} u;
};
The only way I found to fit it within 32 (or 16, respectively) bytes is:
struct Lisp_String
{
INTERVAL intervals;
union {
struct {
unsigned gcmarkbit : 1;
unsigned immbit : 1;
EMACS_INT size : 7;
EMACS_INT size_byte : 7;
unsigned char data[STRING_IMM_MAX];
} imm;
struct {
unsigned unused : 2;
EMACS_INT size : BITS_PER_EMACS_INT - 1;
EMACS_INT size_byte : BITS_PER_EMACS_INT - 1;
unsigned char *data;
} __attribute__ ((packed)) dat;
} u;
};
It's worth mentioning that only DAT should be packed, not IMM.
Dmitry
- Re: immediate strings #2, (continued)
- Re: immediate strings #2, Andreas Schwab, 2011/11/28
- Re: immediate strings #2, Stefan Monnier, 2011/11/28
- Re: immediate strings #2, Andreas Schwab, 2011/11/28
- Re: immediate strings #2, Ken Raeburn, 2011/11/28
- Re: immediate strings #2, Andreas Schwab, 2011/11/29
- Re: immediate strings #2, Ken Raeburn, 2011/11/29
- Re: immediate strings #2, Andreas Schwab, 2011/11/29
- Re: immediate strings #2, Ken Raeburn, 2011/11/30
Re: immediate strings #2, Paul Eggert, 2011/11/28
- Re: immediate strings #2, Stefan Monnier, 2011/11/28
- Re: immediate strings #2,
Dmitry Antipov <=
- Re: immediate strings #2, Paul Eggert, 2011/11/29
- Re: immediate strings #2, Dmitry Antipov, 2011/11/30
- Re: immediate strings #2, Paul Eggert, 2011/11/30
- Re: immediate strings #2, Ken Raeburn, 2011/11/30
- Re: immediate strings #2, Paul Eggert, 2011/11/30
Re: immediate strings #2, Dmitry Antipov, 2011/11/28
Re: immediate strings #2, Dmitry Antipov, 2011/11/29