|
|
Home » Developing U++ » U++ Developers corner » Know what you're using. Size of some common types.
Know what you're using. Size of some common types. [message #57902] |
Mon, 27 December 2021 19:33 |
Lance
Messages: 526 Registered: March 2007
|
Contributor |
|
|
Test result
Now I have redone the test in Release mode, the result is not as eye-catching.
Event<> is of the same size as void *, this is better than I had expected. Of course actual memory used might be more than that: a thisfn with the sizeof of member function pointer and an object pointer for this will have difficulty to fit in the room for a void *.
Using 64 bit for context. I would think a ScrollBar is too big for the job it does. Ideally it should be done without containing 4 Buttons or Button should somehow be compacted to use significantly less room and leave some functions to derived class or optionally(pay per use) memory allocated from heap.
Anyway, the result is quite satisfying and reassuring.
BTW, test program:#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>
#include <TabBar/TabBar.h>
using namespace Upp;
#define SZ(t) "\n"#t"\t" << sizeof(t) /*<<"\t"<<alignof(t)*/
GUI_APP_MAIN
{
String s;
s << SZ(void *)
<< SZ(Value)
<< SZ(String)
<< SZ(Event<>)
<< SZ(Vector<int>)
<< SZ(Button)
<< SZ(EditField)
<< SZ(ScrollBar)
<< SZ(TabBarCtrl)
<< SZ(ArrayCtrl)
<< SZ(GridCtrl);
RLOG(s);
}
-
Attachment: a.png
(Size: 21.55KB, Downloaded 477 times)
[Updated on: Mon, 27 December 2021 20:42] Report message to a moderator
|
|
|
|
|
Know what you're using. Size of some common types.
By: Lance on Mon, 27 December 2021 19:33
|
|
|
Re: Know what you're using. Size of some common types.
By: Klugier on Mon, 27 December 2021 19:58
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Mon, 27 December 2021 20:32
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Mon, 27 December 2021 20:37
|
|
|
Re: Know what you're using. Size of some common types.
By: Klugier on Mon, 27 December 2021 21:42
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 28 December 2021 02:29
|
|
|
Re: Know what you're using. Size of some common types.
By: Novo on Tue, 28 December 2021 05:17
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 28 December 2021 20:27
|
|
|
Re: Know what you're using. Size of some common types.
By: Novo on Tue, 28 December 2021 23:49
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Wed, 29 December 2021 01:42
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Thu, 30 December 2021 02:39
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 31 December 2021 19:51
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 31 December 2021 20:20
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 31 December 2021 20:28
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Wed, 05 January 2022 10:47
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 07 January 2022 17:25
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 07 January 2022 17:44
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Fri, 07 January 2022 18:34
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 07 January 2022 19:01
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Fri, 07 January 2022 19:26
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Fri, 07 January 2022 22:22
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Sun, 09 January 2022 20:36
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Mon, 10 January 2022 01:07
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Mon, 10 January 2022 02:00
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Mon, 10 January 2022 21:43
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 11 January 2022 02:29
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Tue, 11 January 2022 13:41
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 11 January 2022 15:19
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 11 January 2022 17:40
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 11 January 2022 22:07
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Tue, 11 January 2022 22:25
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Wed, 11 May 2022 09:42
|
|
|
Re: Know what you're using. Size of some common types.
By: Novo on Thu, 12 May 2022 08:26
|
|
|
Re: Know what you're using. Size of some common types.
By: Lance on Sat, 14 May 2022 21:30
|
|
|
Re: Know what you're using. Size of some common types.
By: mirek on Fri, 07 January 2022 18:32
|
Goto Forum:
Current Time: Tue Apr 23 17:50:16 CEST 2024
Total time taken to generate the page: 0.02889 seconds
|
|
|