Skip to content

refactor: DynamicTree and Distance APIs for performance and safety#70

Merged
ikpil merged 1 commit intomainfrom
pr/refactor--DynamicTree-and-Distance-APIs-for-performance-and-safety
Dec 25, 2025
Merged

refactor: DynamicTree and Distance APIs for performance and safety#70
ikpil merged 1 commit intomainfrom
pr/refactor--DynamicTree-and-Distance-APIs-for-performance-and-safety

Conversation

@ikpil
Copy link
Copy Markdown
Owner

@ikpil ikpil commented Dec 25, 2025

  • Updated B2DynamicTrees internal methods (b2IsLeaf, b2IsAllocated) to use in B2TreeNode.
  • Optimized tree traversal in B2DynamicTrees by using ref readonly for node access.
  • Changed b2PartitionSAH and b2ShapeDistance to accept Span<T> instead of arrays, reducing allocations.
  • Added B2_UNUSED overload for Span<T> support in B2Diagnostics.
  • These changes improve memory efficiency and enforce read-only semantics for critical data structures.

- Updated `B2DynamicTrees` internal methods (`b2IsLeaf`, `b2IsAllocated`) to use `in B2TreeNode`.
- Optimized tree traversal in `B2DynamicTrees` by using `ref readonly` for node access.
- Changed `b2PartitionSAH` and `b2ShapeDistance` to accept `Span<T>` instead of arrays, reducing allocations.
- Added `B2_UNUSED` overload for `Span<T>` support in `B2Diagnostics`.
- These changes improve memory efficiency and enforce read-only semantics for critical data structures.
@ikpil ikpil merged commit b9d5286 into main Dec 25, 2025
10 checks passed
@ikpil ikpil deleted the pr/refactor--DynamicTree-and-Distance-APIs-for-performance-and-safety branch December 25, 2025 08:50
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