POV-Ray : Newsgroups : povray.programming : Memory problems Server Time
3 Jul 2024 05:56:45 EDT (-0400)
  Memory problems (Message 1 to 9 of 9)  
From: Kevin Loney
Subject: Memory problems
Date: 28 Sep 2003 23:26:40
Message: <3f77a670@news.povray.org>
I've taken and modified the Reflect function so I can pass it a pointer to a
finish like this

static void Reflect(VECTOR IPoint, RAY *Ray, VECTOR Normal, VECTOR
Raw_Normal, COLOUR Colour, DBL Weight, FINISH *Finish)

however whenever I pass anything besides a NULL pointer as the finish
parameter when POV-Ray reaches the object, it crashes and displays a message
about an error reading memory. Any thoughts on why it is doing this? I've
never encountered a problem like this and any assistance would be greatly
appreciated.

Thanks

-- 
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr(
"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

From: ABX
Subject: Re: Memory problems
Date: 29 Sep 2003 02:59:20
Message: <hulfnvk8j6ctm4kmdf43cqfp6k01ohnebp@4ax.com>
On Sun, 28 Sep 2003 21:30:54 -0600, "Kevin Loney" <kev### [at] ekoikcom> wrote:
> I've taken and modified the Reflect function so I can pass it a pointer to a
> finish like this
>
> static void Reflect(VECTOR IPoint, RAY *Ray, VECTOR Normal, VECTOR
> Raw_Normal, COLOUR Colour, DBL Weight, FINISH *Finish)
>
> however whenever I pass anything besides a NULL pointer as the finish
> parameter when POV-Ray reaches the object, it crashes and displays a message
> about an error reading memory. Any thoughts on why it is doing this? I've
> never encountered a problem like this and any assistance would be greatly
> appreciated.

Hard to say anything without more info.

ABX


Post a reply to this message

From: Kevin Loney
Subject: Re: Memory problems
Date: 30 Sep 2003 16:56:37
Message: <3f79ee05@news.povray.org>
The only other thing is that every time the is a call to Reflect(...) it has
been replaced with Reflect(..., NULL) except in the case of Reflect(...,
Layer->Finish) in compute_lighted_texture()

-- 
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr(
"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Memory problems
Date: 30 Sep 2003 18:10:23
Message: <3F79FF4E.4020308@free.fr>
> The only other thing is that every time the is a call to Reflect(...) it has
> been replaced with Reflect(..., NULL) except in the case of Reflect(...,
> Layer->Finish) in compute_lighted_texture()

	That's still not enough to analyze what's wrong with your code.
	If you've added one parameter to the Reflect() function, most
likely you also added some code IN the function itself to handle this
new parameter. This added code is what you've been asked for...

	- NC


Post a reply to this message

From: Kevin Loney
Subject: Re: Memory problems
Date: 30 Sep 2003 18:26:05
Message: <3f7a02fd@news.povray.org>
thats the thing, I haven't added any code yet

-- 
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr(
"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Memory problems
Date: 1 Oct 2003 07:10:34
Message: <3F7AB62A.3030902@free.fr>
> thats the thing, I haven't added any code yet

	Recompile all the povray source code including your change.
	That might help getting rid of the crash.

	- NC


Post a reply to this message

From: Kevin Loney
Subject: Re: Memory problems
Date: 1 Oct 2003 11:07:32
Message: <3f7aedb4@news.povray.org>
Tried that several times already. I'm pretty sure it has something to do
with Layer->Finish, because I've tried a few other things with it since and
it appears to be the source of my grief.

-- 
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr(
"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

From: caffeinebill
Subject: Re: Memory problems
Date: 3 Oct 2003 16:15:01
Message: <web.3f7dd6ec713652bd6c93cf30@news.povray.org>
Kevin Loney wrote:
>The only other thing is that every time the is a call to Reflect(...) it has
>been replaced with Reflect(..., NULL) except in the case of Reflect(...,
>Layer->Finish) in compute_lighted_texture()
>

Based on the prototype for the Reflect function you included earlier,
is Layer->Finish a pointer
to Finish?  Or is it a Finish structure?  Not knowing how the Layer struct
is
defined (as I haven't looked at the source code ever), but considering the
error your are receiving, I would guess it is not a pointer, in which case
you should use Reflect(...,&(Layer->Finish)).

Otherwise, maybe you are not properly populating Layer->Finish.


Post a reply to this message

From: Kevin Loney
Subject: Re: Memory problems
Date: 3 Oct 2003 23:47:35
Message: <3f7e42d7@news.povray.org>
It is a pointer, so I can rule that out. If it wasn't a point then when ever
I compiled vc would give me error messages which I'm not getting. and I know
it is populated properly because I'm using in the same funtion just a little
before and it works fine.

This is starting to look more and more like one of those inexplicable errors
that no one can solve :-P

-- 
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr(
"oqshilacefg",r,1))-97;disc{<mod(i,7)-3,
div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.