Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Test result

index.php?t=getfile&id=6553&private=0

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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED][Question] Is anyone able to build UPP and Binaries based upon it as 32-Bit?
Next Topic: Source Code Efficiency Minor Issue
Goto Forum:
  


Current Time: Tue Apr 23 17:50:16 CEST 2024

Total time taken to generate the page: 0.02889 seconds