-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix buffer corruption that is still happening on run() #64
Fix buffer corruption that is still happening on run() #64
Conversation
The append implementation strangely works just not the original version. |
Ok, I think I understand what's going on now! So no matter what the buffer needs to copied every time which is what append is doing essentially. If something modifies the buffer in t.handleOutput then it will be corrupted upon return. Unless we hunt down what's changing the buffer in t.handleOutput it will need to be copied every time. |
This is the best/simplest implementation I can find. Luckily it's simpler than the previous implementation. Someone who is more knowledgeable about buffer handling can probably optimize this. Sorry, I couldn't remove the buffer copy. |
Increased buffer size to 32KB to fit in most L1 cache the 4KB buffer is an old I/O standard for files on old hardware. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for hunting this down
Buffer corruption was still happening
due to the use of Append instead of Copy. Copy is more precise.I've tried to make an if statement to skip the Copying on when leftover is length zero, but for some reason it always adds back in corruption. I'm really not sure why other than deeper memory handling that I'm not seeing.