Skip to content

Conversation

@jonathandw743
Copy link

Changed da macros to use . instead of ->.
The da macros should be able to be used on values and pointers (which they currently are) using:
arena_da_append(a, da, item) where da is a pointer, which expands to code using (da)->capacity and
arena_da_append(a, &da, item) where da is a value, which expands to code using (&da)->capacity
(da)->capacity is good
(&da)->capacity is not good because it is usually optimised to da.capacity, but this is not guaranteed.
But, in this PR, the calling code would use:
arena_da_append(a, *da, item) where da is a pointer, which expands to code using (*da).capacity and
arena_da_append(a, da, item) where da is a value, which expands to code using (da).capacity
(*da).capacity is good because it is equivalent to da->capacity
(da).capacity is good

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.

1 participant