Skip to content

Conversation

@bp0
Copy link
Collaborator

@bp0 bp0 commented Jul 7, 2019

@lpereira, what do you think about just having two sets for name, value, icon, tag, where one set is const and the other always gets freed? The the proper member can just be set for whichever is appropriate. If the string should be owned by the info field struct set .name, if not set .name_const, etc, This replaces the free_on_flatten members for each one. The info_field_get_*() macros return whichever is set for convenience.
This PR implements the idea in info.{h,c} but doesn't change any uses of it, so don't expect it to compile.

@lpereira
Copy link
Owner

We can make everything non-const and just have a boolean to free -- a lot of places will copy the Info struct, and pointers are bigger; booleans are 1-byte only (barring alignment issues), so should be slightly better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants