|
|
|
|
|
by mpweiher
696 days ago
|
|
You make sure you don't do that. A trick to avoid reading beyond the end of the buffer is to make sure the end of the buffer lies on the same page. Typically, the OS will allocate memory in pages of 4KB, thus we can make a function that checks whether it is okay to read beyond or if we should fallback to the copy version. -- https://ogxd.github.io/articles/unsafe-read-beyond-of-death/ |
|
But it sounds like the masking feature mentioned in a sibling comment takes care of it anyway.