comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: More efficient method of appending to arrays when using pointers?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: More efficient method of appending to arrays when using pointers? [message #74164] Tue, 04 January 2011 14:54 Go to previous message
Matt Francis is currently offline  Matt Francis
Messages: 94
Registered: May 2010
Member
On Jan 5, 9:44 am, nata <bernat.puigdomen...@gmail.com> wrote:
> Try this:
>
> temp = [ TEMPORARY(*self.foo),next_array ]
> ptr_free,self.foo
> self.free = ptr_new(temp,/NO_COPY)
>
> When you are creating the new pointer you are duplicating memory.
> The same occurs when you are retrieving the content of *self.foo. Use
> the function TEMPORARY and the keyword NO_COPY, your code will be more
> efficient.
>
> Cheers,
> nata

Thanks Nata. I see from the TEMPORARY docs that it works by using some
scratch space IDL keeps allocated on hand. Do you know if there is an
upper limit on the size of the arrays you use this approach with
before you don't gain any efficiency (or start to be slower than not
using TEMPORARY), for instance because you are using more memory than
IDL keeps on hand for use with TEMPORARY?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to extract a scalar from a vector?
Next Topic: Re: Associating GeoTiFF tags with basic Mercator projection parameters?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:20:14 PDT 2025

Total time taken to generate the page: 0.00407 seconds