Fast path in Slab::find()
commit319f27150addb15377a17f9b290c52e394c8dc5d
authorEdwin Smith <smith@fb.com>
Fri, 5 Jan 2018 21:41:16 +0000 (5 13:41 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 5 Jan 2018 22:03:38 +0000 (5 14:03 -0800)
tree346c603089949a84dc91fb3f7f63a99c02eee9f5
parentf99b6bc91a47e188b82ed34faa85719ee11553e2
Fast path in Slab::find()

Summary:
Most pointers point directly to the start of an object, even though
we support interior pointers. Check the common case before searching
backwards for the start bit.

When the check succeeds, we can avoid computing the object's size;
refactor the API to return HeapObject* instead of HdrBlock, since
we don't really need to know the size at this point. Downgrade a
few logging counters to count objects instead of bytes.

Reviewed By: swtaarrs

Differential Revision: D6655679

fbshipit-source-id: b2186c6a807706a4151fe0ef465e17f38defe58a
hphp/runtime/base/heap-collect.cpp
hphp/runtime/base/memory-manager-defs.h
hphp/runtime/test/slab-test.cpp