Skip to content

Fix infinite loop in the buffer when capacity is set to 0#68

Closed
peterzhu2118 wants to merge 1 commit into
masterfrom
pz-fix-capacity-infinite-loop
Closed

Fix infinite loop in the buffer when capacity is set to 0#68
peterzhu2118 wants to merge 1 commit into
masterfrom
pz-fix-capacity-infinite-loop

Conversation

@peterzhu2118
Copy link
Copy Markdown
Contributor

If we try to allocate a buffer with capacity set to 0, resizing it will cause an infinite loop because new_capacity *= 2; will always be 0.

@dylanahsmith
Copy link
Copy Markdown
Contributor

I actually had a commit to fix this (80d8587) in #59

I could extract that so it could be reviewed and merged in isolation.

@peterzhu2118
Copy link
Copy Markdown
Contributor Author

@dylanahsmith That would be great!

@peterzhu2118
Copy link
Copy Markdown
Contributor Author

Closing because #70 is merged.

@peterzhu2118 peterzhu2118 deleted the pz-fix-capacity-infinite-loop branch October 6, 2020 13:23
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