1.23
2.0
acw/focus-triggers
main
test-branch
| Rev | Line | |
|---|
| [a0852d1] | 1 | #include <civlc.h>
|
|---|
| 2 |
|
|---|
| 3 | $heap root;
|
|---|
| 4 | $heap *h = &root;
|
|---|
| 5 | int *p;
|
|---|
| 6 | _Bool start = $false;
|
|---|
| 7 |
|
|---|
| 8 | void f(){
|
|---|
| 9 | $heap fh;
|
|---|
| 10 |
|
|---|
| 11 | $when(start);
|
|---|
| 12 | p = (int*) $malloc(h, sizeof(int));
|
|---|
| 13 | h = &fh;
|
|---|
| 14 | //$free(&fh, p);
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | void g(){
|
|---|
| 18 | $heap gh;
|
|---|
| 19 |
|
|---|
| 20 | $when(start);
|
|---|
| 21 | h = &gh;
|
|---|
| 22 | //p = (int*) $malloc(h, sizeof(int));
|
|---|
| 23 | //$free(&gh, p);
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | void main(){
|
|---|
| 27 | $proc ps[2];
|
|---|
| 28 |
|
|---|
| 29 | ps[0] = $spawn f();
|
|---|
| 30 | ps[1] = $spawn g();
|
|---|
| 31 | start = $true;
|
|---|
| 32 | $wait ps[0];
|
|---|
| 33 | $wait ps[1];
|
|---|
| 34 | $free(h, p);
|
|---|
| 35 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.