#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"
{
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;
_glthread_UNLOCK_MUTEX(fenced_list->mutex);
- free(fenced_list);
+ FREE(fenced_list);
}
#include <assert.h>
#include <stdlib.h>
+#include "p_util.h"
+
#include "pb_buffer.h"
#include "pb_buffer_fenced.h"
#include "pb_bufmgr.h"
fenced_mgr->provider->destroy(fenced_mgr->provider);
- free(fenced_mgr);
+ FREE(fenced_mgr);
}
{
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;
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;
}
#include "p_compiler.h"
#include "p_thread.h"
#include "p_defines.h"
+#include "p_util.h"
#include "pb_buffer.h"
#include "pb_bufmgr.h"
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);
}
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;
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;
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;
}