summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,
return 0;
}
+void
+nouveau_resource_destroy(struct nouveau_resource **heap)
+{
+ if (!*heap)
+ return;
+ free(*heap);
+ *heap = NULL;
+}
+
int
nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv,
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
nouveau_resource_init(struct nouveau_resource **heap, unsigned start,
unsigned size);
+void
+nouveau_resource_destroy(struct nouveau_resource **heap);
+
int
nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv,
struct nouveau_resource **);