[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef object

From: Mike Miller
Subject: [Octave-bug-tracker] [bug #55810] sizeof() returns 0 for classdef objects
Date: Sun, 3 Mar 2019 16:44:33 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36

Update of bug #55810 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                Priority:              5 - Normal => 3 - Low                


Follow-up Comment #6:

Since 'sizeof' is not a defined Matlab function or object method, it's
intentionally not used as an override when getting the size of objects in

I tested with 'containers.Map' in the Matlab online feature, and the size of
the map object is 8 bytes, regardless of how many entries are added to the

I found this:

Where a Mathworks employee wrote

> Unfortunately, there is no way to check the amount of memory that is being
> occupied by class objects, since MATLAB is storing references to C++
> objects. As you say, whos is representing the size of the pointer to the
> created object, which will be 60 bytes (in 32-bit) or 112 bytes (in
> However, you can create a function in your class and calculate the real
> memory of the object by manually querying for the memory of each of the
> properties in the class, like you do with whos for a matrix.

So I think we can choose to return whatever we want to for 'whos' and 'sizeof'
on class objects, since there is no compatibility problem here.


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]