Bug 1792146: Make replace_malloc_usable_size succeed with pointers within allocation...
commit706117a7d7cd3022102d579466dc2a17dbe94373
authorBrad Werth <bwerth@mozilla.com>
Thu, 9 Mar 2023 23:12:20 +0000 (9 23:12 +0000)
committerBrad Werth <bwerth@mozilla.com>
Thu, 9 Mar 2023 23:12:20 +0000 (9 23:12 +0000)
tree51ff8ba0977d85acf3c362aa5abf9f2fe2c76a82
parentc738d5a247099e854e0c726e048bdbcf418c7a7a
Bug 1792146: Make replace_malloc_usable_size succeed with pointers within allocation pages. r=glandium

This changes replace_malloc_usable_size to allow measuring the size of
ptrs that appear anywhere within an allocation page, not just ptrs to the
start of the allocation pages.

This also modifies a gtest to explicitly check the usable size of some
modified pointers, not just the usable size of the pages where those
pointers are located.

Differential Revision: https://phabricator.services.mozilla.com/D170963
memory/replace/phc/PHC.cpp
memory/replace/phc/test/gtest/TestPHC.cpp