isl_map_free: return NULL
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 16 Aug 2012 15:19:56 +0000 (17:19 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 6 Sep 2012 13:45:20 +0000 (15:45 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/map.h
isl_map.c

index e30eb97..2a286eb 100644 (file)
@@ -1284,7 +1284,7 @@ functions.
        void *isl_set_free(__isl_take isl_set *set);
        void *isl_union_set_free(__isl_take isl_union_set *uset);
        void *isl_basic_map_free(__isl_take isl_basic_map *bmap);
-       void isl_map_free(__isl_take isl_map *map);
+       void *isl_map_free(__isl_take isl_map *map);
        void *isl_union_map_free(__isl_take isl_union_map *umap);
 
 Other sets and relations can be constructed by starting
index fdef473..7f86644 100644 (file)
@@ -308,7 +308,7 @@ __isl_give isl_map *isl_map_lex_ge_first(__isl_take isl_space *dim, unsigned n);
 __isl_give isl_map *isl_map_lex_gt(__isl_take isl_space *set_dim);
 __isl_give isl_map *isl_map_lex_ge(__isl_take isl_space *set_dim);
 struct isl_map *isl_map_finalize(struct isl_map *map);
-void isl_map_free(__isl_take isl_map *map);
+void *isl_map_free(__isl_take isl_map *map);
 __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map);
 struct isl_map *isl_map_extend(struct isl_map *base,
                unsigned nparam, unsigned n_in, unsigned n_out);
index 3d06e71..a43f5af 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -5059,21 +5059,23 @@ error:
        return NULL;
 }
 
-void isl_map_free(struct isl_map *map)
+void *isl_map_free(struct isl_map *map)
 {
        int i;
 
        if (!map)
-               return;
+               return NULL;
 
        if (--map->ref > 0)
-               return;
+               return NULL;
 
        isl_ctx_deref(map->ctx);
        for (i = 0; i < map->n; ++i)
                isl_basic_map_free(map->p[i]);
        isl_space_free(map->dim);
        free(map);
+
+       return NULL;
 }
 
 struct isl_map *isl_map_extend(struct isl_map *base,