Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor vector wrappers #154

Closed
rainyl opened this issue Jul 12, 2024 · 0 comments · Fixed by #155
Closed

Refactor vector wrappers #154

rainyl opened this issue Jul 12, 2024 · 0 comments · Fixed by #155
Labels
enhancement New feature or request

Comments

@rainyl
Copy link
Owner

rainyl commented Jul 12, 2024

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.

@rainyl rainyl added the enhancement New feature or request label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant