The current impl of vector wrappers are not efficient, getting the elements inside them will perform a deep copy, however, return a reference is much better.
So I am going to refactor the wrappers of vectors to use structs:
typedef struct {
Point *ptr;
size_t length;
} VecPoint;
In this way, we can get it's length without allocating memories comparing to the current impl, which will be more efficient and convenient to interact with the List (or Iterable) of dart.
The current impl of vector wrappers are not efficient, getting the elements inside them will perform a deep copy, however, return a reference is much better.
So I am going to refactor the wrappers of vectors to use structs:
In this way, we can get it's length without allocating memories comparing to the current impl, which will be more efficient and convenient to interact with the
List
(orIterable
) of dart.