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.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.