[Bf-committers] Post-2.40 release AMD64 question (re: shadbuf.c)

Ken Hughes khughes at pacific.edu
Wed Nov 30 01:56:34 CET 2005

Thought I'd ask while it was still fresh in my mind:

While going through the code looking for 64-bit issues, I came across 
this code in RE_initshadowbuf():

shb->zbuf= (unsigned long *) MEM_mallocN(
	sizeof(unsigned long)*
	(shb->size*shb->size)/256, "initshadbuf2");

The code seems to work fine on 64-bit platforms.  However, it also means 
the shadow buffer is 4 times larger than on 32-bit systems.

Since the each entry in the buffer is either a pointer to 
MEM_mallocN()'d memory or a 32-bit int (an RGBA color), seems like this 
would be a good candidate for Ton's POINTER_TO_INT /INT_TO_POINTER 
macros (and declaring the buffer unsigned int).

Nod if you agree :-)


More information about the Bf-committers mailing list