source: src/examples/gc_no_raii/src/gcpointers.h @ 00c32e9

aaron-thesisarm-ehcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 00c32e9 was bee4283, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

GC files now compile, still working on a compiling example

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5
6struct gcpointer_t
7{
8        intptr_t ptr;
9        struct gcpointer_t* next;
10};
11
12void ?{}(gcpointer_t* this);
13void ?{}(gcpointer_t* this, void* address);
14void ?{}(gcpointer_t* this, gcpointer_t other);
15void ^?{}(gcpointer_t* this);
16gcpointer_t* ?=?(gcpointer_t this, gcpointer_t rhs);
17
18//Logical operators
19bool gcpointer_equal(gcpointer_t* this, gcpointer_t* rhs);
20bool gcpointer_not_equal(gcpointer_t* this, gcpointer_t* rhs);
21bool gcpointer_null(gcpointer_t* this);
22
23forall(otype T)
24struct gcpointer
25{
26        gcpointer_t internal;
27};
28
29//
30forall(otype T) void ?{}(gcpointer(T)* this);
31forall(otype T) void ?{}(gcpointer(T)* this, void* address);
32forall(otype T) void ctor(gcpointer(T)* this, void* address);
33forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other);
34forall(otype T) void ^?{}(gcpointer(T)* this);
35forall(otype T) gcpointer(T) ?=?(gcpointer(T) this, gcpointer(T) rhs);
36
37
38forall(otype T) T *?(gcpointer(T) this);
39
40//Logical operators
41forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
42forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
Note: See TracBrowser for help on using the repository browser.