Skip to content

fix: reset capacity_ after ShareData and ShareDiff#7127

Open
Chessing234 wants to merge 1 commit into
BVLC:masterfrom
Chessing234:fix/5439-sharedata-reset-capacity
Open

fix: reset capacity_ after ShareData and ShareDiff#7127
Chessing234 wants to merge 1 commit into
BVLC:masterfrom
Chessing234:fix/5439-sharedata-reset-capacity

Conversation

@Chessing234

Copy link
Copy Markdown

Fixes #5439

Summary

After ShareData() or ShareDiff() shares memory with another blob, the local capacity_ no longer reflects the shared buffer. Reset it to zero so a later Reshape() allocates new storage instead of relying on stale capacity.

Test plan

  • Code change matches issue description
  • Existing blob unit tests pass

Made with Cursor

After sharing memory with another blob, the local capacity is no longer
valid for the shared buffer. Reset capacity_ to zero so a subsequent
Reshape allocates fresh storage instead of reusing stale capacity.

Fixes BVLC#5439.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

ShareData() should reset capacity_

1 participant