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
typedefstruct {
lv_ll_tsubs_ll; /**< Subscribers */uint32_ttype : 4; /**< One of the LV_SUBJECT_TYPE_... values */uint32_tsize : 28; /**< String buffer size or group length */lv_subject_value_tvalue; /**< Current value */lv_subject_value_tprev_value; /**< Previous value */uint32_tnotify_restart_query : 1; /**< If an Observer was deleted during notifcation, start notifying from the beginning. */void*user_data; /**< Additional parameter, can be used freely by user */
} lv_subject_t;
to
typedefstruct {
lv_ll_tsubs_ll; /**< Subscribers */lv_subject_value_tvalue; /**< Current value */lv_subject_value_tprev_value; /**< Previous value */void*user_data; /**< Additional parameter, can be used freely by user */uint32_ttype : 4; /**< One of the LV_SUBJECT_TYPE_... values */uint32_tsize : 27; /**< String buffer size or group length */uint32_tnotify_restart_query : 1; /**< If an Observer was deleted during notifcation, start notifying from the beginning. */
} lv_subject_t;
to save 4 bytes of memory (32 bytes => 28 bytes) for each lv_subject_t?
Since these are internal values, it would not break the API, and would limit the size of string buffers and group lists to 134217727. It might even be worth considering to reduce the number of bits in the size field even further to reserve a few bits for the future. Just a thought.
The text was updated successfully, but these errors were encountered:
Introduce the problem
Hi, @kisvegabor
Proposal
What would you think of changing
to
to save 4 bytes of memory (32 bytes => 28 bytes) for each
lv_subject_t
?Since these are internal values, it would not break the API, and would limit the size of string buffers and group lists to 134217727. It might even be worth considering to reduce the number of bits in the
size
field even further to reserve a few bits for the future. Just a thought.The text was updated successfully, but these errors were encountered: