| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| if (length <= INLINE_SIZE) { | ||
| // to clear the memory segment of view being written to | ||
| // if it has been set | ||
| if (viewBuffer.getLong(writePosition) != 0 || viewBuffer.getLong(writePosition + 8) != 0) { |
There was a problem hiding this comment.
So the basic effect is that if the view buffer is all 0, we skip setting it back to 0? And basically, for freshly allocated memory, this skips a redundant memset? Can we explain it a little more in the comment?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, it's redundant to setZero if the data is already zero. Checking will introduce some overhead, but it is much smaller than that of setMemory.
Sorry, something went wrong.
There was a problem hiding this comment.
Update in 16c9e2f
Sorry, something went wrong.
There was a problem hiding this comment.
Is it safe to check only these positions? IIUC, ZERO is a valid value to be set.
Sorry, something went wrong.
There was a problem hiding this comment.
But if all 16 bytes are 0, there is no need to set them to 0 again, I think is the point.
Sorry, something went wrong.
There was a problem hiding this comment.
@wgtmac are we on the same page here?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, it sounds good.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #41.