Skip to content

Make dynamic tree more serialization friendly#1036

Merged
erincatto merged 1 commit intomainfrom
dyntree_serialize_help
Mar 8, 2026
Merged

Make dynamic tree more serialization friendly#1036
erincatto merged 1 commit intomainfrom
dyntree_serialize_help

Conversation

@erincatto
Copy link
Owner

minor change

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make b2DynamicTree more serialization-friendly/deterministic by ensuring predictable initialization and by using fixed-width integer types in the public tree struct definition.

Changes:

  • Zero-initialize b2DynamicTree in b2DynamicTree_Create to avoid nondeterministic padding bytes.
  • Change b2DynamicTree member types in the public header from int/int* to int32_t/int32_t* for stable, fixed-width representation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/dynamic_tree.c Adds memset of the returned tree struct to ensure deterministic byte state.
include/box2d/collision.h Updates b2DynamicTree struct fields to fixed-width integer types/pointers to improve serialization stability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@erincatto erincatto merged commit 5778d74 into main Mar 8, 2026
13 checks passed
@erincatto erincatto deleted the dyntree_serialize_help branch March 8, 2026 04:26
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.

2 participants