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

Marcus Overhagen marcusoverhagen at arcor.de
Thu Aug 16 12:15:29 CEST 2007


axeld at BerliOS <axeld at mail.berlios.de> wrote:

> +	if ((alignment & 3) != 0 || _pointer == NULL)
> +		return B_BAD_VALUE;

for 32 and 64 bit compatiblity, you could check for 

if (alignment % sizeof(void *))
or 
if (alignment & (sizeof(void *) - 1)

I think we should keep the posix memptr name instead of using _pointer

> +	static processHeap *pHeap = getAllocator();
> +	void *pointer = pHeap->getHeap(pHeap->getHeapIndex()).memalign(alignment,
> +		size);
> +	if (pointer == NULL)
> +		return NULL;

Thats broken. Returning 0 indicated success.

	if (pointer == NULL)
		return B_NO_MEMORY;

regards
Marcus

Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT FÜR ALLE NEUEINSTEIGER
Jetzt bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket
für clevere Doppel-Sparer, nur  34,95 €  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2



More information about the Haiku-commits mailing list