8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_ADLC_ARENA_HPP
26 #define SHARE_VM_ADLC_ARENA_HPP
27
28 // All classes in adlc may be derived
29 // from one of the following allocation classes:
30 //
31 // For objects allocated in the C-heap (managed by: malloc & free).
32 // - CHeapObj
33 //
34 // For classes used as name spaces.
35 // - AllStatic
36 //
37
38 class CHeapObj {
39 public:
40 void* operator new(size_t size) throw();
41 void operator delete(void* p);
42 void* new_array(size_t size);
43 };
44
45
46 // Base class for classes that constitute name spaces.
47
48 class AllStatic {
49 public:
50 void* operator new(size_t size) throw();
51 void operator delete(void* p);
52 };
53
54
55 //------------------------------Chunk------------------------------------------
56 // Linked list of raw memory chunks
57 class Chunk: public CHeapObj {
58 private:
59 // This ordinary operator delete is needed even though not used, so the
60 // below two-argument operator delete will be treated as a placement
61 // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
62 void operator delete(void* p);
63 public:
64 void* operator new(size_t size, size_t length) throw();
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_ADLC_ARENA_HPP
26 #define SHARE_VM_ADLC_ARENA_HPP
27
28 void* AllocateHeap(size_t size);
29
30 // All classes in adlc may be derived
31 // from one of the following allocation classes:
32 //
33 // For objects allocated in the C-heap (managed by: malloc & free).
34 // - CHeapObj
35 //
36 // For classes used as name spaces.
37 // - AllStatic
38 //
39
40 class CHeapObj {
41 public:
42 void* operator new(size_t size) throw();
43 void operator delete(void* p);
44 void* new_array(size_t size);
45 };
46
47 // Base class for classes that constitute name spaces.
48
49 class AllStatic {
50 public:
51 void* operator new(size_t size) throw();
52 void operator delete(void* p);
53 };
54
55
56 //------------------------------Chunk------------------------------------------
57 // Linked list of raw memory chunks
58 class Chunk: public CHeapObj {
59 private:
60 // This ordinary operator delete is needed even though not used, so the
61 // below two-argument operator delete will be treated as a placement
62 // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
63 void operator delete(void* p);
64 public:
65 void* operator new(size_t size, size_t length) throw();
|