Last change
on this file since db19e1d was
87b9332,
checked in by Andrew Beach <ajbeach@…>, 4 years ago
|
Moved 'examples/' to 'tests/zombies/'.
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #pragma once |
---|
2 | |
---|
3 | #include <stdbool.h> |
---|
4 | #include <stddef.h> |
---|
5 | #include <stdint.h> |
---|
6 | |
---|
7 | #include "tools.h" |
---|
8 | |
---|
9 | #ifndef NDEBUG |
---|
10 | static void* const CANARY_VALUE = (void*)0xCAFEBABACAFEBABA; |
---|
11 | #endif |
---|
12 | |
---|
13 | struct gcpointer_t; |
---|
14 | struct gc_object_header; |
---|
15 | |
---|
16 | struct gc_object_header |
---|
17 | { |
---|
18 | #ifndef NDEBUG |
---|
19 | void* canary_start; |
---|
20 | #endif |
---|
21 | |
---|
22 | size_t size; |
---|
23 | gcpointer_t* root_chain; |
---|
24 | gcpointer_t* type_chain; |
---|
25 | gc_object_header* forward; |
---|
26 | bool is_forwarded; |
---|
27 | |
---|
28 | #ifndef NDEBUG |
---|
29 | void* canary_end; |
---|
30 | #endif |
---|
31 | }; |
---|
32 | |
---|
33 | void ctor(gc_object_header* const this, size_t size); |
---|
34 | void copy_ctor(gc_object_header* const this, const gc_object_header* const other); |
---|
35 | |
---|
36 | static inline gc_object_header* placement_ctor(void* address, size_t size) |
---|
37 | { |
---|
38 | gc_object_header* const this = (gc_object_header* const) address; |
---|
39 | ctor(this, size); |
---|
40 | return this; |
---|
41 | } |
---|
42 | |
---|
43 | static inline gc_object_header* placement_copy_ctor(void* address, const gc_object_header* const other) |
---|
44 | { |
---|
45 | gc_object_header* const this = (gc_object_header* const) address; |
---|
46 | copy_ctor(this, other); |
---|
47 | return this; |
---|
48 | } |
---|
49 | |
---|
50 | #ifndef NDEBUG |
---|
51 | bool is_valid(const gc_object_header* const this); |
---|
52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.