source:
CIVL/examples/library/civlc/bundleAndHeap.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 317 bytes | |
| Rev | Line | |
|---|---|---|
| [a4a8ef7] | 1 | #include <civlc.cvh> |
| 2 | #include <bundle.cvh> | |
| 3 | ||
| 4 | $input int N; | |
| [3ff27cf] | 5 | $assume(N > 2); |
| [a4a8ef7] | 6 | $input int a[N]; |
| 7 | ||
| [d66b03b] | 8 | $scope root = $here; |
| 9 | ||
| [a4a8ef7] | 10 | int main(){ |
| 11 | int * b; | |
| 12 | $bundle bun; | |
| 13 | ||
| [d66b03b] | 14 | b = (int *)$malloc(root, N * sizeof(int)); |
| [a4a8ef7] | 15 | bun = $bundle_pack(a, sizeof(int) * N); |
| 16 | $bundle_unpack(bun, b); | |
| [3ff27cf] | 17 | $assert(b[0] == a[0]); |
| [a4a8ef7] | 18 | $free(b); |
| 19 | return 0; | |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
