| 
  | 
Hi,
I've been working on an experimental port of Povray 3.6.1 to a new platform:
one on which a long is 64-bits, and a pointer 32. I've been tracking down an
error due to the end of a block of memory being over-written and have narrowed
it down to the file source/lighting.cpp. This contains the following code in
InitMallocPools():
  ShadowMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long
*), "temp media list");
  LightingMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long
*), "temp media list");
  MediaIntervalPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long *),
"temp media list");
The fix would obviously be to replace the "*sizeof (long *)" with
"sizeof(long)":
  ShadowMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long),
"temp media list");
  LightingMediaListPoolSize = (long
*)POV_MALLOC(MaxMediaPoolDepth*sizeof(long), "temp media list");
  MediaIntervalPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long),
"temp media list");
Apologies if I'm not reporting this to the right place, or it was fixed long
ago...!
HTH,
Paul
 
 Post a reply to this message 
 | 
  | 
 | 
  | 
Paul Bowen-Huggett wrote:
> [...]
> 
> Apologies if I'm not reporting this to the right place, or it was fixed long
> ago...!
It's the correct place and this seems indeed a bug - seems like systems 
with sizeof(long) > sizeof(pointer) are extremely rare.
Christoph
-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
 
 Post a reply to this message 
 | 
  |