Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
libpointers without memcopy

Subject: libpointers without memcopy

From: kees de Kapper

Date: 1 Mar, 2013 08:54:07

Message: 1 of 1

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,


Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us