Jeff Preshing
65p225 comments posted · 3 followers · following 0
3 years ago @ Preshing on Programming - How C Resolves a Fun... · 0 replies · +2 points
3 years ago @ Preshing on Programming - How C Resolves a Fun... · 0 replies · +2 points
3 years ago @ Preshing on Programming - I/O in Plywood · 1 reply · +2 points
I'd like to understand the problem you're describing a little better. Can you give an example of a bug that you want to be able to avoid?
3 years ago @ Preshing on Programming - I/O in Plywood · 0 replies · +2 points
I think you're right about StringWriters. When the application writes text to a StringWriter, it's providing all the source string(s), and so the I/O system *could* convert directly from the source string to the temporary output buffer. At least for newline conversion (let's say).
This would change the API for StringWriter to some extent, and we would have to reserve a few bits from InStream::status to indicate what kind of newline conversion is performed by the StringWriter, but I think it would work. So that might not be a bad suggestion. I'm still not sure it would be easy/worthwhile to eliminate one of the buffers in the StringReader case though.
3 years ago @ Preshing on Programming - I/O in Plywood · 2 replies · +2 points
To flip the question back around, how would you expect to eliminate one of the buffers? For example, what kind of data would you be reading? If you're reading a line of text, you don't know how long the line will be until after you've read it, so in general, there's no way to know what size of String to allocate ahead of time.
5 years ago @ Preshing on Programming - Memory Ordering at Com... · 0 replies · +4 points
5 years ago @ Preshing on Programming - Acquire and Release Fe... · 0 replies · +2 points
5 years ago @ Preshing on Programming - Acquire and Release Fe... · 0 replies · +2 points
5 years ago @ Preshing on Programming - Acquire and Release Se... · 0 replies · +4 points
5 years ago @ Preshing on Programming - The Synchronizes-With ... · 1 reply · +4 points