source: src/examples/gc_no_raii/src/gcpointers.h @ bee4283

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 bee4283 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
RevLine 
[15db1ab]1#pragma once
2
[f1e42c1]3#include <stdbool.h>
[6be0cf9]4#include <stdint.h>
5
[15db1ab]6struct gcpointer_t
7{
[6be0cf9]8        intptr_t ptr;
[15db1ab]9        struct gcpointer_t* next;
10};
11
[bee4283]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);
[15db1ab]17
18//Logical operators
[f1e42c1]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
[bee4283]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);
[f1e42c1]36
37
[bee4283]38forall(otype T) T *?(gcpointer(T) this);
[f1e42c1]39
40//Logical operators
[bee4283]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.