This forum has been archived. All content is frozen. Please use KDE Discuss instead.

assignment memory usage

Tags: None
(comma "," separated)
johnm1019
Registered Member
Posts
46
Karma
0

assignment memory usage

Tue Aug 21, 2012 12:21 pm
Hi, I was curious how memory is handled when objects with the assignment operator in Eigen.

If I do
Eigen::ArrayXf myArray, someOtherArray;
Initialize them, put some data inside.

when I do,

myArray = someOtherArray;

Does myArray try to minimize its re-allocation with a conservativeResize?
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: assignment memory usage

Wed Aug 22, 2012 12:25 pm
Hi,

Assignment uses resize and not conservativeResize thus re-allocations are never used.

The question on the other hand side is whether re-allocation is faster than a simple allocation of uninitialized memory. I guess the current approach is already optimal.

Regards,
Hauke


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]