Re: [Mesa3d-dev] os_malloc_aligned fails on 64bit

2010-02-04 Thread Andreia Gaita
>> On Thu, 2010-02-04 at 09:14 -0800, Andreia Gaita wrote: >> Hi everyone, >> >> On os_memory_aiigned.h, os_malloc_aligned does: >> >> buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1) & >> ~(alignment - 1)); >> >> which gets clamped to 32 bits and fails rather spectacularly on 64 >>

Re: [Mesa3d-dev] os_malloc_aligned fails on 64bit

2010-02-04 Thread José Fonseca
On Thu, 2010-02-04 at 09:14 -0800, Andreia Gaita wrote: > Hi everyone, > > On os_memory_aiigned.h, os_malloc_aligned does: > > buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1) & > ~(alignment - 1)); > > which gets clamped to 32 bits and fails rather spectacularly on 64 > bits, th

[Mesa3d-dev] os_malloc_aligned fails on 64bit

2010-02-04 Thread Andreia Gaita
Hi everyone, On os_memory_aiigned.h, os_malloc_aligned does: buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1) & ~(alignment - 1)); which gets clamped to 32 bits and fails rather spectacularly on 64 bits, the NOR needs a long cast to work properly. I've attached a patch with the f