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

Custom Vec/Seq with destructors #421

Open
mratsim opened this issue Jul 5, 2024 · 1 comment
Open

Custom Vec/Seq with destructors #421

mratsim opened this issue Jul 5, 2024 · 1 comment

Comments

@mratsim
Copy link
Owner

mratsim commented Jul 5, 2024

Constantine does not use seq to ensure it does not depend on Nim runtime and to allow end user to pick their allocator of choice, for example jemalloc for long-running application or mimalloc. This also helps using address sanitizer or Valgrind on the library.

However manual memory management is tedious and error prone so we likely need to add a custom vector type. Which shouldn't need redimensioning.

The name is up in the air as we might not want to conflate computer science vectors with mathematical vectors should we need some in the future.

@mratsim
Copy link
Owner Author

mratsim commented Jul 6, 2024

See https://nim-lang.org/docs/destructors.html for a tutorial

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

No branches or pull requests

1 participant