The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: libpointers without memcopy
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
kees de kapper

Posts: 86
Registered: 12/7/04
libpointers without memcopy
Posted: Mar 1, 2013 3:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear all,

I don't understand the implementation of libpointers in Matlab.

If I create a libpointer to a variable, it will copy the content (value) of the variable as well. I expected to retrieve only a pointer to the memory location and not a memcopy.
To make it more clear:
Img = ones(1000,100,100); % Increases memory usage with 78292 bytes
ImgPtr = libpointer('doublePtr', Img); % Also increases memory usage with 78292 bytes

With this in mind, it doesn't matter if I make a copy of the data or use the pointer way. I'm trying to save memory usage but this doesn't work.

Is there a way to get only a pointer or is this not implemented?

Thanks in advance!

Kind regards,


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.