[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Fix #1136 and a question about type specia
Re: [Chicken-hackers] [PATCH] Fix #1136 and a question about type specialisation
Wed, 23 Jul 2014 20:15:31 +0200
On Sun, Jul 13, 2014 at 02:08:11PM +0200, Peter Bex wrote:
> Hi all,
> Here's a simple patch for #1136, which is more-or-less the same bug as
> the one pointed out by Mario for string-copy!, but for move-memory!
> There's a second bug in the type specialisation for move-memory!: it
> would expand to C_w2b(), which is a macro which was defined locally to
> lolevel.scm. Luckily, the macro's expansion was identical to the
> expansion of C_bytes() so that's easy to fix. I decided to use C_bytes
> in lolevel.scm as well; no need to have duplicate definitions of the
> same thing.
As pointed out by Christian, this patch is incomplete: the test it adds
fails on the BSDs due to the fact that these rewrites expand to
C_copy_ptr_memory, which still uses C_memcpy(). I don't know why it
works on Linux, probably just a slight difference in the memcpy()
implementation in libc.
The attached patch is an updated version which also changes the
implementation of C_copy_ptr_memory to use memmove().
Again, this patch should go into the stability branch!
Description: Text document