2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
13 struct isl_basic_set_list *isl_basic_set_list_alloc(struct isl_ctx *ctx, int n)
15 struct isl_basic_set_list *list;
17 isl_assert(ctx, n >= 0, return NULL);
18 list = isl_alloc(ctx, struct isl_basic_set_list,
19 sizeof(struct isl_basic_set_list) +
20 (n - 1) * sizeof(struct isl_basic_set *));
32 struct isl_basic_set_list *isl_basic_set_list_add(
33 struct isl_basic_set_list *list,
34 struct isl_basic_set *bset)
38 isl_assert(list->ctx, list->n < list->size, goto error);
39 list->p[list->n] = bset;
43 isl_basic_set_free(bset);
44 isl_basic_set_list_free(list);
48 void isl_basic_set_list_free(struct isl_basic_set_list *list)
58 isl_ctx_deref(list->ctx);
59 for (i = 0; i < list->n; ++i)
60 isl_basic_set_free(list->p[i]);