bug-guile
[Top][All Lists]
Advanced

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

bug#14599: An option to make vector allocation aligned


From: Ludovic Courtès
Subject: bug#14599: An option to make vector allocation aligned
Date: Thu, 13 Jun 2013 15:31:01 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Hi,

Thanks for sharing your thoughts on this!

Jan Schukat <address@hidden> skribis:

> Extending the programming api to support this is a bit more tricky. I
> guess most straightforward and backward compatible would be to just at
> a set of make-aligned-*vector and aligned-*vector and
> *->aligned-*vector functions and their scm_* versions with an
> additional alignment parameter. Optional alignment parameters on the
> old functions could be nice too, but I guess that is just asking for
> compatibility trouble.

What about something like ‘make-aligned-bytevector’?  This should be
enough, since bytevectors can be accessed through the SRFI-4 API (info
"(guile) Bytevectors as Uniform Arrays").  (And it can already be
implemented in Scheme, as I showed previously.)

> The other question is the read syntax (one of the primary reasons I'm
> doing all this). If alignment is something that should be preserved in
> the permanent representation, you also need to store it in the flags,
> since the content pointer can be aligned by coincidence. I haven't
> looked at the compiling of bytevectors yet, to see if alignment can be
> handled easily there.

I agree that we’d need some sort of annotation to specify the alignment
of literals, but adding read syntax for that scares me somewhat.  What
do people think?

On the compilation side, I think alignment will be more easily handled
in 2.2 (current ‘master’), which uses ELF (think of GCC’s ‘alignment’
attribute.)

None of this really seems doable in the 2.0 stable series.  So for now
you’d have to resort to one of the options discussed.

WDYT?

Thanks,
Ludo’.





reply via email to

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