From: Dmitry Antipov <antipov@mvista.com>
To: emacs-devel@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>,
Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: Re: immediate strings #2
Date: Tue, 29 Nov 2011 07:37:16 +0400 [thread overview]
Message-ID: <4ED4536C.6040500@yandex.ru> (raw)
In-Reply-To: <jwvfwh7adml.fsf-monnier+emacs@gnu.org>
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
next prev parent reply other threads:[~2011-11-29 3:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-28 9:11 immediate strings #2 Dmitry Antipov
2011-11-28 17:33 ` Stefan Monnier
2011-11-28 19:48 ` Ken Raeburn
2011-11-28 20:10 ` Andreas Schwab
2011-11-28 21:54 ` Stefan Monnier
2011-11-28 22:25 ` Andreas Schwab
2011-11-29 0:57 ` Ken Raeburn
2011-11-29 8:44 ` Andreas Schwab
2011-11-29 15:48 ` Ken Raeburn
2011-11-29 16:08 ` Andreas Schwab
2011-11-30 16:43 ` Ken Raeburn
2011-11-28 22:18 ` Paul Eggert
2011-11-29 2:07 ` Stefan Monnier
2011-11-29 3:37 ` Dmitry Antipov [this message]
2011-11-29 8:50 ` Paul Eggert
2011-11-30 5:37 ` Dmitry Antipov
2011-11-30 9:35 ` Paul Eggert
2011-11-30 16:43 ` Ken Raeburn
2011-11-30 21:44 ` Paul Eggert
2011-11-29 3:17 ` Dmitry Antipov
2011-11-29 5:29 ` Dmitry Antipov
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ED4536C.6040500@yandex.ru \
--to=antipov@mvista.com \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.