Marcin Slusarz
2010-Jan-12 14:31 UTC
[Nouveau] [libdrm PATCH 1/4] nouveau: add nouveau_resource_destroy
From: Marcin Slusarz <marcin.slusarz at gmail.com> Subject: [libdrm PATCH] nouveau: add nouveau_resource_destroy --- nouveau/nouveau_resource.c | 9 +++++++++ nouveau/nouveau_resource.h | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/nouveau/nouveau_resource.c b/nouveau/nouveau_resource.c index 6bef756..7acaf7d 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 988d246..b760dfb 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 **); -- 1.6.6.rc3
Maarten Maathuis
2010-Jan-14 23:02 UTC
[Nouveau] [libdrm PATCH 1/4] nouveau: add nouveau_resource_destroy
Is everyone ok with this api addition (naming ok?)? On Tue, Jan 12, 2010 at 3:31 PM, Marcin Slusarz <marcin.slusarz at gmail.com> wrote:> From: Marcin Slusarz <marcin.slusarz at gmail.com> > Subject: [libdrm PATCH] nouveau: add nouveau_resource_destroy > > --- > ?nouveau/nouveau_resource.c | ? ?9 +++++++++ > ?nouveau/nouveau_resource.h | ? ?3 +++ > ?2 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/nouveau/nouveau_resource.c b/nouveau/nouveau_resource.c > index 6bef756..7acaf7d 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 988d246..b760dfb 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 **); > -- > 1.6.6.rc3 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau >