[Haiku-commits] r21975 - in haiku/trunk: headers/posix src/system/libroot/posix/malloc

Ingo Weinhold bonefish at cs.tu-berlin.de
Thu Aug 16 12:38:07 CEST 2007


On 2007-08-16 at 12:04:45 [+0200], axeld at BerliOS <axeld at mail.berlios.de> 
wrote:
>  
>  extern "C" int
> -posix_memalign(void **memptr, size_t alignment, size_t size)
> +posix_memalign(void **_pointer, size_t alignment, size_t size)
>  {
> -    if (!memptr)
> -        return EINVAL;
> -    *memptr = memalign(alignment, size);
> -    if (memptr == NULL)
> -        return ENOMEM;
> -    return 0;
> +    if ((alignment & 3) != 0 || _pointer == NULL)
> +        return B_BAD_VALUE;

Why not "(sizeof(void*) - 1)" instead of the hardcoded 3?

CU, Ingo



More information about the Haiku-commits mailing list