|
|
er...@seriss.com schrieb am Dienstag, 16. April 2024 um 17:05:31 UTC+2:
On 4/15/24 12:38, 'Matthias Melcher' via fltk.general wrote:
I like to use a trick to avoid re-allocating menu item
arrays:
Huh, I never worried about re-allocating menu item arrays..
do you avoid it because it's slow, or is the idea to allow
pointers to not change?
Reallocating unnecessarily fragments memory. find_item() walks the menu array every time. It's all absolutely irrelevant on a modern PC. I like that menus are not reallocated and my pointers stay valid. Especially under FLUID, which calculates widget addresses during initialization, this would be a concern. It does not really matter.
So, yes, find_item() every time is just as fine.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5f2eef19-e624-4da8-a14b-61222d153532n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |