2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
19 #include <folly/DiscriminatedPtr.h>
32 * Logical reverse mapping from memory address ranges to the VM objects
36 ///////////////////////////////////////////////////////////////////////////////
39 * Register the start address of an object.
41 * The object pointer must be 16-byte aligned.
43 void register_start(const ArrayData
*);
44 void register_start(const Class
*);
45 void register_start(const Func
*);
46 void register_start(const NamedEntity
*);
47 void register_start(const StringData
*);
48 void register_start(const Unit
*);
51 * Deregister an object.
53 * Requires that register_start() was called on the object, and it has not yet
56 void deregister(const ArrayData
*);
57 void deregister(const Class
*);
58 void deregister(const Func
*);
59 void deregister(const NamedEntity
*);
60 void deregister(const StringData
*);
61 void deregister(const Unit
*);
64 * Look up the object containing `addr' as an internal pointer.
66 * This function is aware of the variable-length allocations of Func, Class,
67 * and StringData, and takes them into consideration for determining
70 * Returns an empty result if `addr' is not mapped.
72 using result
= folly::DiscriminatedPtr
<
80 result
find_containing(const void* addr
);
82 ///////////////////////////////////////////////////////////////////////////////