aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz2010-01-12 08:31:28 -0600
committerFrancisco Jerez2010-01-31 09:09:03 -0600
commit55ba98fadfb8909d23d6f810285504abd173f0ad (patch)
tree4a1b67927c5060f67cb05349508b1d2dddcf11a6 /nouveau
parent44a0e0a099eeeb6501359f08449dcaa5e9899398 (diff)
downloadlibdrm-55ba98fadfb8909d23d6f810285504abd173f0ad.tar.gz
libdrm-55ba98fadfb8909d23d6f810285504abd173f0ad.tar.xz
libdrm-55ba98fadfb8909d23d6f810285504abd173f0ad.zip
nouveau: add nouveau_resource_destroy
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_resource.c9
-rw-r--r--nouveau/nouveau_resource.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/nouveau/nouveau_resource.c b/nouveau/nouveau_resource.c
index 6bef7567..7acaf7db 100644
--- a/nouveau/nouveau_resource.c
+++ b/nouveau/nouveau_resource.c
@@ -41,6 +41,15 @@ nouveau_resource_init(struct nouveau_resource **heap,
41 return 0; 41 return 0;
42} 42}
43 43
44void
45nouveau_resource_destroy(struct nouveau_resource **heap)
46{
47 if (!*heap)
48 return;
49 free(*heap);
50 *heap = NULL;
51}
52
44int 53int
45nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, 54nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv,
46 struct nouveau_resource **res) 55 struct nouveau_resource **res)
diff --git a/nouveau/nouveau_resource.h b/nouveau/nouveau_resource.h
index 988d2466..b760dfbb 100644
--- a/nouveau/nouveau_resource.h
+++ b/nouveau/nouveau_resource.h
@@ -38,6 +38,9 @@ int
38nouveau_resource_init(struct nouveau_resource **heap, unsigned start, 38nouveau_resource_init(struct nouveau_resource **heap, unsigned start,
39 unsigned size); 39 unsigned size);
40 40
41void
42nouveau_resource_destroy(struct nouveau_resource **heap);
43
41int 44int
42nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, 45nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv,
43 struct nouveau_resource **); 46 struct nouveau_resource **);