5 /*@dependent@*/ int *z;
8 extern void pair_keep (/*@keep@*/ pair p);
10 extern /*@only@*/ /*@out@*/ void *smalloc (size_t);
11 extern /*@partial@*/ pair pair_part (void);
13 /*@only@*/ pair pair_copy (pair p)
15 pair ret = (pair) smalloc (sizeof (*ret));
21 return (ret); /* 1. Storage p->x reachable from parameter is kept (should be only) */
22 } /* 2. Storage p->y reachable from parameter is kept (should be only) */
24 /*@only@*/ pair pair_create (void)
26 pair p = (pair) smalloc (sizeof (*p));
28 p->x = smalloc (sizeof (int));
29 p->y = smalloc (sizeof (int));
30 p->z = p->y; /* 3. Only storage p->y assigned to dependent: p->z = p-y */
35 return p; /* 4. Storage p->y reachable from return value is unqualified */
38 pair pair_swankle (/*@keep@*/ pair p)
40 pair ret = pair_part ();
43 pair_keep (p); /* 5. Storage p->x reachable from passed parameter is kept */
44 p->x = smalloc (sizeof (int));