From 0fe428f1dfafe6bfb8896e0a08cbe12d569497d7 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 23 Jan 2008 15:47:10 +0100 Subject: [PATCH] d3d: Fix build on Windows. --- src/mesa/pipe/pipebuffer/pb_buffer_fenced.c | 5 +++-- src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c | 8 +++++--- src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c | 13 +++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c index ad2da71c4a7..5b33a42e193 100644 --- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c +++ b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c @@ -42,6 +42,7 @@ #include "p_compiler.h" #include "p_winsys.h" #include "p_thread.h" +#include "p_util.h" #include "pb_buffer.h" #include "pb_buffer_fenced.h" @@ -248,7 +249,7 @@ fenced_buffer_list_create(struct pipe_winsys *winsys) { struct fenced_buffer_list *fenced_list; - fenced_list = (struct fenced_buffer_list *)calloc(1, sizeof(*fenced_list)); + fenced_list = (struct fenced_buffer_list *)CALLOC(1, sizeof(*fenced_list)); if (!fenced_list) return NULL; @@ -292,7 +293,7 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list) _glthread_UNLOCK_MUTEX(fenced_list->mutex); - free(fenced_list); + FREE(fenced_list); } diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c index 28996b9a176..734d5bdceb2 100644 --- a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c +++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c @@ -37,6 +37,8 @@ #include #include +#include "p_util.h" + #include "pb_buffer.h" #include "pb_buffer_fenced.h" #include "pb_bufmgr.h" @@ -100,7 +102,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr) fenced_mgr->provider->destroy(fenced_mgr->provider); - free(fenced_mgr); + FREE(fenced_mgr); } @@ -110,7 +112,7 @@ fenced_bufmgr_create(struct pb_manager *provider, { struct fenced_pb_manager *fenced_mgr; - fenced_mgr = (struct fenced_pb_manager *)calloc(1, sizeof(*fenced_mgr)); + fenced_mgr = (struct fenced_pb_manager *)CALLOC(1, sizeof(*fenced_mgr)); if (!fenced_mgr) return NULL; @@ -120,7 +122,7 @@ fenced_bufmgr_create(struct pb_manager *provider, fenced_mgr->provider = provider; fenced_mgr->fenced_list = fenced_buffer_list_create(winsys); if(!fenced_mgr->fenced_list) { - free(fenced_mgr); + FREE(fenced_mgr); return NULL; } diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c b/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c index 1e213074f14..9d7dbd5eb95 100644 --- a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c +++ b/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c @@ -43,6 +43,7 @@ #include "p_compiler.h" #include "p_thread.h" #include "p_defines.h" +#include "p_util.h" #include "pb_buffer.h" #include "pb_bufmgr.h" @@ -203,14 +204,14 @@ pool_bufmgr_destroy(struct pb_manager *mgr) struct pool_pb_manager *pool = pool_pb_manager(mgr); _glthread_LOCK_MUTEX(pool->mutex); - free(pool->bufs); + FREE(pool->bufs); pb_unmap(pool->buffer); pb_destroy(pool->buffer); _glthread_UNLOCK_MUTEX(pool->mutex); - free(mgr); + FREE(mgr); } @@ -223,7 +224,7 @@ pool_bufmgr_create(struct pb_manager *provider, struct pool_buffer *pool_buf; size_t i; - pool = (struct pool_pb_manager *)calloc(1, sizeof(*pool)); + pool = (struct pool_pb_manager *)CALLOC(1, sizeof(*pool)); if (!pool) return NULL; @@ -248,7 +249,7 @@ pool_bufmgr_create(struct pb_manager *provider, if(!pool->map) goto failure; - pool->bufs = (struct pool_buffer *) malloc(numBufs * sizeof(*pool->bufs)); + pool->bufs = (struct pool_buffer *) MALLOC(numBufs * sizeof(*pool->bufs)); if (!pool->bufs) goto failure; @@ -265,12 +266,12 @@ pool_bufmgr_create(struct pb_manager *provider, failure: if(pool->bufs) - free(pool->bufs); + FREE(pool->bufs); if(pool->map) pb_unmap(pool->buffer); if(pool->buffer) pb_destroy(pool->buffer); if(pool) - free(pool); + FREE(pool); return NULL; } -- 2.30.2