OSDN Git Service

nouveau: add nouveau_resource_destroy
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 12 Jan 2010 14:31:28 +0000 (15:31 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 31 Jan 2010 15:09:03 +0000 (16:09 +0100)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
nouveau/nouveau_resource.c
nouveau/nouveau_resource.h

index 6bef756..7acaf7d 100644 (file)
@@ -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)
index 988d246..b760dfb 100644 (file)
@@ -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 **);