686a9be68d2b32a3d45051c356c479a41155192e
[platform/upstream/isl.git] / isl_ctx.c
1 #include "isl_ctx.h"
2 #ifdef ISL_POLYLIB
3 #include <polylib/polylibgmp.h>
4 #endif
5
6 struct isl_ctx *isl_ctx_alloc()
7 {
8         struct isl_ctx *ctx;
9
10         ctx = isl_alloc_type(NULL, struct isl_ctx);
11         if (!ctx)
12                 return NULL;
13
14         isl_int_init(ctx->one);
15         isl_int_set_si(ctx->one, 1);
16
17 #ifdef ISL_POLYLIB
18         ctx->MaxRays = POL_NO_DUAL | POL_INTEGER;
19 #endif
20
21         return ctx;
22 }
23
24 void isl_ctx_free(struct isl_ctx *ctx)
25 {
26         if (!ctx)
27                 return;
28         isl_int_clear(ctx->one);
29         free(ctx);
30 }