Skip to content

Fix/rust move semantics#704

Open
madmax983 wants to merge 1 commit intounum-cloud:main-devfrom
madmax983:fix/rust-move-semantics
Open

Fix/rust move semantics#704
madmax983 wants to merge 1 commit intounum-cloud:main-devfrom
madmax983:fix/rust-move-semantics

Conversation

@madmax983
Copy link

@madmax983 madmax983 commented Jan 15, 2026

fix(rust): call reserve() after heap allocation to prevent segfaults

Calling reserve() on stack-allocated index before moving to heap stores dangling pointers, causing crashes when Index is used in Rust structs, Box, Arc, or any moved context.

Move reserve() call to wrap() function after heap allocation.

Just as a reference this came up with trying to implement usearch in https://github.com/madmax983/GallifreyDB to replace hnsw_rs.

@madmax983 madmax983 force-pushed the fix/rust-move-semantics branch from ca8a021 to 423f45f Compare February 17, 2026 15:48
@madmax983 madmax983 force-pushed the fix/rust-move-semantics branch from 30173d7 to e978d87 Compare February 17, 2026 16:32
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