Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colblk: safeguard against Go pointer rule violations in DataBlockRewr…
…iter Go pointer rules require that a Go pointer always point to a byte within a valid allocation. The DataBlockRewriter previously would allocate buffers for keys exactly sized for the largest user key contained within a block. If one were to use pointer arithmetic to compute an exclusive pointer to byte beyond the key, this pointer would violate Go's pointer rules. As far as I can tell, we don't do this today because only PrefixBytesIter performs pointer arithmetic that might violate this by computing a pointer to the beginning of the suffix. This is only problematic if there is no suffix, but suffix-rewriting always requires a suffix. To be safe, we allocate an extra byte.
- Loading branch information