Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: libpointers without memcopy
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
kees de kapper

Posts: 71
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,

Kees



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.