Replies: 4 comments
-
Possible data structures: A. Classic style struct Vararray
{
usize size;
usize capacity;
Allocator allocator; // Typically 2 pointers wide
Type *array
} Stb style: struct Dynarray
{
usize size;
usize capacity;
Allocator allocator; // Typically 2 pointers wide
Type array[0]
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Advantages to (A):
Disadvantages
Advantages of B:
Disadvantages of B
|
Beta Was this translation helpful? Give feedback.
0 replies
-
B can be have two different semantics as well, depending on how efficient one wants it to be. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Vararrays will be moved into the standard library. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Questions:
null
or an empty structBeta Was this translation helpful? Give feedback.
All reactions