4 struct isl_basic_set_list
*isl_basic_set_list_alloc(struct isl_ctx
*ctx
, int n
)
6 struct isl_basic_set_list
*list
;
8 isl_assert(ctx
, n
>= 0, return NULL
);
9 list
= isl_alloc(ctx
, struct isl_basic_set_list
,
10 sizeof(struct isl_basic_set_list
) +
11 (n
- 1) * sizeof(struct isl_basic_set
*));
23 struct isl_basic_set_list
*isl_basic_set_list_add(
24 struct isl_basic_set_list
*list
,
25 struct isl_basic_set
*bset
)
29 isl_assert(list
->ctx
, list
->n
< list
->size
, goto error
);
30 list
->p
[list
->n
] = bset
;
34 isl_basic_set_free(bset
);
35 isl_basic_set_list_free(list
);
39 void isl_basic_set_list_free(struct isl_basic_set_list
*list
)
49 isl_ctx_deref(list
->ctx
);
50 for (i
= 0; i
< list
->n
; ++i
)
51 isl_basic_set_free(list
->p
[i
]);