We were miscalculating the length of the buffer in pointer-sized chunks,
which is what the conservative root scan cares about.
This could cause some values to be prematurely garbage-collected.
(cherry picked from commit 2fb3b6c542db3a86cbd1aa7e34d470e34c485372)