POV-Ray : Newsgroups : povray.general : best practice question : Re: best practice question Server Time
24 Apr 2024 16:35:15 EDT (-0400)
  Re: best practice question  
From: jr
Date: 12 Jun 2020 16:15:00
Message: <web.5ee3e14a701429d44d00143e0@news.povray.org>
hi,William F Pokorny <ano### [at] anonymousorg> wrote:
> On 6/11/20 3:49 AM, jr wrote:
> > Alain Martel <kua### [at] videotronca> wrote:
> >> Le 2020-06-09 à 06:07, jr a écrit :
> >>> I have a macro which expands to an array, eg
> >>> ...
> ...
> I'm not familiar with the new-ish array / dictionary functionality or
> code, but I think POV-Ray will let you know if an undef is required. You
> cannot redefine functions for example, without first an undef(2).
>
> It should be the previous memory gets freed(1) on the new declare if
> POV-Ray allows it.

agree.

> Perhaps proceed as if all OK, and worry about undefs
> if you see memory growth?

is what I'm doing now, fingers crossed, "flying by the seat of the pants".  :-(

> In such a case, I'd consider the lack of a
> parser error message (or not freeing memory automatically) a bug.
>
> (1) - IIRC memory use is higher with the newer features. Both because
> mixed array elements are all of a size which accommodates the largest.
> And on growth the increments are in some sort of multiple of the
> existing size. Again, not familiar with the code and I have not myself
> used it. All Christoph's work.

both mixed arrays and dynamic arrays are used, together.

(will 'clipka' be able to chip in, at some point?  (I must have missed what
happened))

> (2) - Undefs are are not going to help with memory fragmentation over
> time in any case supposing you are allocating and freeing a large number
> of varying arrays.

had not considered fragmentation.  how does it work, POV-Ray allocates all in
advance and doles out, or allocates on demand?  with relatively large arrays
being created/overwriting an existing, is there a rule of thumb for estimating
memory consumption[*]?

[*] another thing missing completely in the documentation.

(will 'povr' provide at least some introspection tools?)

> Aside: Anyone else find the #declare, #undef (un-define) pairing
> inconsistent. ;-)

I don't think it too bad since it covers '#declare'd and '#local's, but I really
think it should allow multiple identifiers, ie
  #undef A1, A2, ...

(with or without commas)


regards, jr.


Post a reply to this message

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