summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-05-27 00:19:41 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-05-27 00:19:41 +0900
commit35cfd0a4900750f67cba4f64929ff3347f0bd46f (patch)
tree23ff08745c1376d56c623a35440e386a0a5e78e0 /src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
parenta0e2955a16a8a04afe7f84b1c8551211542a6fbd (diff)
pipebuffer: Malloc buffer provider.
Simple wrapper around pb_malloc_buffer_create for convenience.
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
index 9e8244f909..6c3502eea7 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
@@ -30,13 +30,14 @@
* Implementation of malloc-based buffers to store data that can't be processed
* by the hardware.
*
- * \author José Fonseca <jrfonseca@tungstengraphics.com>
+ * \author Jose Fonseca <jrfonseca@tungstengraphics.com>
*/
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pb_buffer.h"
+#include "pb_bufmgr.h"
struct malloc_buffer
@@ -125,3 +126,33 @@ pb_malloc_buffer_create(size_t size,
return &buf->base;
}
+
+
+static struct pb_buffer *
+pb_malloc_buffer_create_buffer(struct pb_manager *mgr,
+ size_t size,
+ const struct pb_desc *desc)
+{
+ return pb_malloc_buffer_create(size, desc);
+}
+
+
+static void
+pb_malloc_bufmgr_destroy(struct pb_manager *mgr)
+{
+ /* No-op */
+}
+
+
+static struct pb_manager
+pb_malloc_bufmgr = {
+ pb_malloc_buffer_create_buffer,
+ pb_malloc_bufmgr_destroy
+};
+
+
+struct pb_manager *
+pb_malloc_bufmgr_create(void)
+{
+ return &pb_malloc_bufmgr;
+}