[PartitionAlloc] Use reciprocal multiplication to speed up GetSlotOffset
Currently, the "get offset of a pointer within its allocated slot" functionality, which is used extensively by several MiraclePtr implementations, performs an expensive modulo operation. This commit replaces it with a cheaper sequence of multiplications and bit shifts. Bug: 1092288 Change-Id: I866689a79fff704b5f83fc07d8f28b3386ef644d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335443 Commit-Queue: Sergei Glazunov <glazunov@google.com> Reviewed-by:Benoit L <lizeb@chromium.org> Reviewed-by:
Bartek Nowierski <bartekn@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#802194}
Showing
Please register or sign in to comment