From: Ken Raeburn <raeburn@raeburn.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: [BDW-GC] Static cell/string/symbol allocation
Date: Tue, 13 Jan 2009 15:57:04 -0500 [thread overview]
Message-ID: <FEFEE29F-5D50-4BBF-AD8C-360C89718C65@raeburn.org> (raw)
In-Reply-To: <87k590cbre.fsf@gnu.org>
On Jan 12, 2009, at 19:04, Ludovic Courtès wrote:
>> union {
>> scm_t_cell cell[2];
>> double d_for_alignment;
>> long long ll_for_alignment;
>> }
>
> The issue with this is that there's nothing telling us how compilers
> should behave when encountering this. Even if the underlying hardware
> has a preferred alignment for these types, the compiler doesn't have
> to
> honor it (on some RISC architectures the alignment can be mandated,
> and
> failing to honor them would lead to SIGBUS). So that appears to be
> quite unreliable.
That's true, there's no guarantee at all. Though I do think Guile is
probably making a bunch of other assumptions about what the compiler
or OS will do, especially when it comes to garbage collection,
equality checks, stuff like that. There's a difference between what's
guaranteed by the language specs and what's reliable in the types of
platforms we'd care about. For many of them, I think the above will
cause the desired alignment; I don't know about all of them.
> ... with code that just keeps using dynamic allocation when
> `SCM_ALIGNED' is undefined.
That works too. The compilers and platforms of greatest interest for
the biggest part of the user community (GCC and Visual Studio, and
then...what else?) are likely to provide some facility for this, so
the performance gain probably only fails to be realized for a small
part of the audience.
Ken
next prev parent reply other threads:[~2009-01-13 20:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 0:02 [BDW-GC] Static cell/string/symbol allocation Ludovic Courtès
2009-01-06 2:11 ` Ken Raeburn
2009-01-13 0:04 ` Ludovic Courtès
2009-01-13 20:57 ` Ken Raeburn [this message]
2009-01-13 0:34 ` Ludovic Courtès
2009-01-15 23:20 ` Ludovic Courtès
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FEFEE29F-5D50-4BBF-AD8C-360C89718C65@raeburn.org \
--to=raeburn@raeburn.org \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).