8000 Review the splitLines() API to avoid allocating zero bytes. by dimitri · Pull Request #638 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Review the splitLines() API to avoid allocating zero bytes. #6 8000 38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

dimitri
Copy link
Owner
@dimitri dimitri commented Jan 16, 2024

Make it systematic to first count the lines and then allocate the right amount of memory for the array of pointers to the start of each line, and make sure we don't try and allocate a zero-size array, which can lead to "corrupted size vs. prev_size" errors at run-time.

See #609

@dimitri dimitri added the bug Something isn't working label Jan 16, 2024
@dimitri dimitri added this to the v0.16 milestone Jan 16, 2024
@dimitri dimitri self-assigned this Jan 16, 2024
Make it systematic to first count the lines and then allocate the right
amount of memory for the array of pointers to the start of each line, and
make sure we don't try and allocate a zero-size array, which can lead to
"corrupted size vs. prev_size" errors at run-time.
@dimitri dimitri merged commit b207fd4 into main Jan 16, 2024
@dimitri dimitri deleted the fix/splitLines branch January 16, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0