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