You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces a twin_raw_* indirection layer between the memory stats
tracking (memstats.c) and the underlying allocator. When CONFIG_MEM_TLSF
is enabled, allocations route through a self-contained TLSF (Two-Level
Segregated Fit) allocator backed by a static pool, providing O(1)
bounded-time malloc/free for real-time embedded targets. When disabled,
twin_raw_* inlines to libc malloc/free with zero overhead.
The TLSF implementation is stripped to static-pool essentials (pool_init,
malloc, realloc, free) and uses the portable twin_clz/twin_clzll helpers
instead of raw compiler intrinsics. A key deviation from upstream TLSF:
block_find_free() trims to the actual request size rather than the bin
minimum, avoiding catastrophic internal fragmentation when small requests
hit large bins.
Move optional widget fields (callback, callback_data, want_focus) into a
lazily-allocated twin_widget_ext_t block. Widgets that never register a
callback keep ext == NULL and save 16 bytes per widget (64-bit) or 8
bytes (32-bit). The copy_geom field stays inline in the base struct for
app-level direct access. All call sites in box.c, button.c, and widget.c
updated to use inline accessors.
0 commit comments