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 » U++ Library support » U++ Core » Adding GetCount/NumBytes to Buffer?
Re: Adding GetCount/NumBytes to Buffer? [message #61680 is a reply to message #61679] Tue, 13 May 2025 14:04 Go to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
FYI: U++ allocator does have means to return the size of allocated block, unfortunately that can be bigger than the size requested by MemoryAlloc, so GetCount implemented as GetMemoryBlockSize(ptr) / sizeof(T) would often return bigger than correct number. So that realistically leaves storing size as second member variable (+8 bytes), which so far was not worth it.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stable Sort algorithm
Next Topic: How do I override the Button class Tip handling function
Goto Forum:
  


Current Time: Sun Jun 08 11:50:51 CEST 2025

Total time taken to generate the page: 0.04257 seconds