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 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_REVERSE_DATA_MAP_H_
18 #define incl_HPHP_REVERSE_DATA_MAP_H_
20 #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 Class
*);
44 void register_start(const Func
*);
45 void register_start(const NamedEntity
*);
46 void register_start(const StringData
*);
47 void register_start(const Unit
*);
50 * Deregister an object.
52 * Requires that register_start() was called on the object, and it has not yet
55 void deregister(const Class
*);
56 void deregister(const Func
*);
57 void deregister(const NamedEntity
*);
58 void deregister(const StringData
*);
59 void deregister(const Unit
*);
62 * Look up the object containing `addr' as an internal pointer.
64 * This function is aware of the variable-length allocations of Func, Class,
65 * and StringData, and takes them into consideration for determining
68 * Returns an empty result if `addr' is not mapped.
70 using result
= folly::DiscriminatedPtr
<
77 result
find_containing(const void* addr
);
79 ///////////////////////////////////////////////////////////////////////////////