ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since 16cfd8c was
16cfd8c,
checked in by Thierry Delisle <tdelisle@…>, 8 years ago
|
1 error left
|
-
Property mode set to
100644
|
File size:
968 bytes
|
Line | |
---|
1 | #pragma once |
---|
2 | |
---|
3 | #include <stddef.h> |
---|
4 | #include <stdint.h> |
---|
5 | |
---|
6 | #include "tools.h" |
---|
7 | |
---|
8 | #if DEBUG |
---|
9 | static const long unsigned int CANARY_VALUE = 0xCAFEBABACAFEBABA; |
---|
10 | #endif |
---|
11 | |
---|
12 | struct gcpointer_t; |
---|
13 | struct gc_object_header; |
---|
14 | |
---|
15 | struct gc_object_header |
---|
16 | { |
---|
17 | #if DEBUG |
---|
18 | void* canary_start; |
---|
19 | #endif |
---|
20 | |
---|
21 | size_t size; |
---|
22 | gcpointer_t* root_chain; |
---|
23 | gcpointer_t* type_chain; |
---|
24 | gc_object_header* forward; |
---|
25 | bool is_forwarded; |
---|
26 | |
---|
27 | #if DEBUG |
---|
28 | void* canary_end; |
---|
29 | #endif |
---|
30 | }; |
---|
31 | |
---|
32 | void ctor(gc_object_header* const this, size_t size); |
---|
33 | void copy_ctor(gc_object_header* const this, const gc_object_header* const other); |
---|
34 | |
---|
35 | static inline gc_object_header* placement_ctor(void* address, size_t size) |
---|
36 | { |
---|
37 | gc_object_header* const this = (gc_object_header* const) address; |
---|
38 | ctor(this, size); |
---|
39 | return this; |
---|
40 | } |
---|
41 | |
---|
42 | static inline gc_object_header* placement_copy_ctor(void* address, const gc_object_header* const other) |
---|
43 | { |
---|
44 | gc_object_header* const this = (gc_object_header* const) address; |
---|
45 | copy_ctor(this, other); |
---|
46 | return this; |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.