isl_basic_set_opt: avoid invalid access on error path
[platform/upstream/isl.git] / isl_id_private.h
1 /*
2  * Copyright 2008-2009 Katholieke Universiteit Leuven
3  *
4  * Use of this software is governed by the MIT license
5  *
6  * Written by Sven Verdoolaege, K.U.Leuven, Departement
7  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8  */
9
10 #ifndef ISL_ID_PRIVATE_H
11 #define ISL_ID_PRIVATE_H
12
13 #include <isl/id.h>
14
15 /* Represent a name and/or user pointer.
16  *
17  * If "free_user" is set, then it will be called on "user" when
18  * the last instance of the isl_id is freed.
19  */
20 struct isl_id {
21         int ref;
22         isl_ctx *ctx;
23
24         const char *name;
25         void *user;
26         uint32_t hash;
27
28         __isl_give void (*free_user)(void *user);
29 };
30
31 uint32_t isl_hash_id(uint32_t hash, __isl_keep isl_id *id);
32
33 extern isl_id isl_id_none;
34
35 #endif