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

Home » Public Forums » archive » Re: On Pointers and Culture
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: On Pointers and Culture [message #42991 is a reply to message #42989] Fri, 04 March 2005 03:25 Go to previous messageGo to previous message
David Lopez Pons is currently offline  David Lopez Pons
Messages: 8
Registered: July 2003
Junior Member
> a = INDGEN(100)
> p = PTR_NEW(a)
>
> This lines creates an 'a' vector and 'p' pointer variable in the
> conventional memory, also copies the same 'a' vector into HEAP memory
> a makes 'p' points this.
> Maybe, it is better:
>
> p = PTR_NEW( INDGEN(100) )
>
> Now, you only have a 'p' pointer variable in conventional memory and
> an array in the HEAP memory.
>
You also can do this to avoid the memory duplication:

a = INDGEN(100)
p = PTR_NEW(a,/NOCOPY)

It's easier if you want to fill 'a' with some sort of complex data :)

> Bye.
> Antonio
>
> (Sorry about mu poor enligh :)

mee too.

Cheers
DLo.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Arrays suck. Loops rock.
Next Topic: surface fitting...

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

Current Time: Sun Nov 30 14:20:42 PST 2025

Total time taken to generate the page: 1.03960 seconds