source: examples/gc_no_raii/src/gcpointers.h @ 97c3159

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 97c3159 was bf71cfd, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Moved up many directories in source

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