source: CIVL/examples/por/heap1.cvl@ be4355b

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since be4355b was 0b9a80a, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

implemented $scopeof expression; removed unused examples; cleaned up library executors and enablers.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@703 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 401 bytes
Line 
1#include <civlc.h>
2
3int *p;
4_Bool start = $false;
5
6void f(){
7 $when(start);
8 p = (int*) $malloc($root, sizeof(int));
9 h = &fh;
10 //$free(&fh, p);
11}
12
13void g(){
14 $heap gh;
15
16 $when(start);
17 h = &gh;
18 //p = (int*) $malloc(h, sizeof(int));
19 //$free(&gh, p);
20}
21
22void 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.