ffbContextPtr fmesa = FFB_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- fmesa->verts = (ffb_vertex *)ALIGN_MALLOC(size * sizeof(ffb_vertex), 32);
+ fmesa->verts = (ffb_vertex *)_mesa_align_malloc(size * sizeof(ffb_vertex), 32);
{
static int firsttime = 1;
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
if (fmesa->verts) {
- ALIGN_FREE(fmesa->verts);
+ _mesa_align_free(fmesa->verts);
fmesa->verts = 0;
}
}
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- gmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
+ gmesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32);
{
static int firsttime = 1;
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
if (gmesa->verts) {
- ALIGN_FREE(gmesa->verts);
+ _mesa_align_free(gmesa->verts);
gmesa->verts = 0;
}
}
{
drmBufMapPtr retval;
- retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32);
+ retval = (drmBufMapPtr)_mesa_align_malloc(sizeof(drmBufMap), 32);
if(retval == NULL) return NULL;
memset(retval, 0, sizeof(drmBufMap));
- retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR, 32);
+ retval->list = (drmBufPtr)_mesa_align_malloc(sizeof(drmBuf) * I810_DMA_BUF_NR, 32);
if(retval->list == NULL) {
- ALIGN_FREE(retval);
+ _mesa_align_free(retval);
return NULL;
}
memset(retval->list, 0, sizeof(drmBuf) * I810_DMA_BUF_NR);
i810ContextPtr imesa = I810_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- imesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
+ imesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32);
{
static int firsttime = 1;
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
if (imesa->verts) {
- ALIGN_FREE(imesa->verts);
+ _mesa_align_free(imesa->verts);
imesa->verts = 0;
}
}
/* Allocate the vertex buffer
*/
- mmesa->vert_buf = ALIGN_MALLOC(MACH64_BUFFER_SIZE, 32);
+ mmesa->vert_buf = _mesa_align_malloc(MACH64_BUFFER_SIZE, 32);
if ( !mmesa->vert_buf )
return GL_FALSE;
mmesa->vert_used = 0;
/* Free the vertex buffer */
if ( mmesa->vert_buf )
- ALIGN_FREE( mmesa->vert_buf );
+ _mesa_align_free( mmesa->vert_buf );
/* free the Mesa context */
mmesa->glCtx->DriverCtx = NULL;
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
+ mmesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32);
{
static int firsttime = 1;
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
if (mmesa->verts) {
- ALIGN_FREE(mmesa->verts);
+ _mesa_align_free(mmesa->verts);
mmesa->verts = 0;
}
}
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * sizeof(mgaVertex), 32);
+ mmesa->verts = (GLubyte *)_mesa_align_malloc(size * sizeof(mgaVertex), 32);
{
static int firsttime = 1;
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
if (mmesa->verts) {
- ALIGN_FREE(mmesa->verts);
+ _mesa_align_free(mmesa->verts);
mmesa->verts = 0;
}
}
firsttime = 0;
}
- fxMesa->verts = ALIGN_MALLOC(size * sizeof(tdfxVertex), 32);
+ fxMesa->verts = _mesa_align_malloc(size * sizeof(tdfxVertex), 32);
fxMesa->vertexFormat = TDFX_LAYOUT_TINY;
fxMesa->SetupIndex = TDFX_XYZ_BIT|TDFX_RGBA_BIT;
}
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
if (fxMesa->verts) {
- ALIGN_FREE(fxMesa->verts);
+ _mesa_align_free(fxMesa->verts);
fxMesa->verts = 0;
}
}
firsttime = 0;
}
- fxMesa->verts = (GrVertex *)ALIGN_MALLOC(size * sizeof(GrVertex), 32);
+ fxMesa->verts = (GrVertex *)_mesa_align_malloc(size * sizeof(GrVertex), 32);
fxMesa->SetupIndex = SETUP_XYZW|SETUP_RGBA;
}
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
if (fxMesa->verts) {
- ALIGN_FREE(fxMesa->verts);
+ _mesa_align_free(fxMesa->verts);
fxMesa->verts = 0;
}
}
/** Free memory */
#define FREE(PTR) free(PTR)
-/** Allocate \p BYTES aligned at \p N bytes */
-#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N)
-/** Allocate and zero \p BYTES bytes aligned at \p N bytes */
-#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N)
-/** Allocate a structure of type \p T aligned at \p N bytes */
-#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
-/** Allocate and zero a structure of type \p T aligned at \p N bytes */
-#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
-/** Free aligned memory */
-#define ALIGN_FREE(PTR) _mesa_align_free(PTR)
-
/*@}*/
(void) cycles;
- mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
mat->inv = m = mat->m;
init_matrix( m );
}
}
- ALIGN_FREE( mat->m );
+ _mesa_align_free( mat->m );
return 1;
}
return 0;
}
- mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
mat->type = mtypes[mtype];
m = mat->m;
}
}
- ALIGN_FREE( mat->m );
+ _mesa_align_free( mat->m );
return 1;
}
void
_math_matrix_ctr( GLmatrix *m )
{
- m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ m->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
if (m->m)
memcpy( m->m, Identity, sizeof(Identity) );
m->inv = NULL;
_math_matrix_dtr( GLmatrix *m )
{
if (m->m) {
- ALIGN_FREE( m->m );
+ _mesa_align_free( m->m );
m->m = NULL;
}
if (m->inv) {
- ALIGN_FREE( m->inv );
+ _mesa_align_free( m->inv );
m->inv = NULL;
}
}
_math_matrix_alloc_inv( GLmatrix *m )
{
if (!m->inv) {
- m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ m->inv = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 );
if (m->inv)
memcpy( m->inv, Identity, 16 * sizeof(GLfloat) );
}
{
v->stride = 4 * sizeof(GLfloat);
v->size = 2;
- v->storage = ALIGN_MALLOC( count * 4 * sizeof(GLfloat), alignment );
+ v->storage = _mesa_align_malloc( count * 4 * sizeof(GLfloat), alignment );
v->storage_count = count;
v->start = (GLfloat *) v->storage;
v->data = (GLfloat (*)[4]) v->storage;
_mesa_vector4f_free( GLvector4f *v )
{
if (v->flags & VEC_MALLOC) {
- ALIGN_FREE( v->storage );
+ _mesa_align_free( v->storage );
v->data = NULL;
v->start = NULL;
v->storage = NULL;
/* a few other misc allocations */
_mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 );
- store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 );
+ store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
return GL_TRUE;
}
/* free misc arrays */
_mesa_vector4f_free( &store->ndcCoords );
- ALIGN_FREE( store->clipmask );
+ _mesa_align_free( store->clipmask );
FREE( store );
stage->privatePtr = NULL;
_mesa_vector4f_alloc( &store->clip, 0, size, 32 );
_mesa_vector4f_alloc( &store->proj, 0, size, 32 );
- store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 );
+ store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
if (!store->clipmask ||
!store->eye.data ||
_mesa_vector4f_free( &store->eye );
_mesa_vector4f_free( &store->clip );
_mesa_vector4f_free( &store->proj );
- ALIGN_FREE( store->clipmask );
+ _mesa_align_free( store->clipmask );
FREE(store);
stage->privatePtr = NULL;
stage->run = init_vertex_stage;
if (max_vertex_size > vtx->max_vertex_size) {
_tnl_free_vertices( ctx );
vtx->max_vertex_size = max_vertex_size;
- vtx->vertex_buf = (GLubyte *)ALIGN_CALLOC(vb_size * max_vertex_size, 32 );
+ vtx->vertex_buf = (GLubyte *)_mesa_align_calloc(vb_size * max_vertex_size, 32 );
invalidate_funcs(vtx);
}
struct tnl_clipspace_fastpath *fp, *tmp;
if (vtx->vertex_buf) {
- ALIGN_FREE(vtx->vertex_buf);
+ _mesa_align_free(vtx->vertex_buf);
vtx->vertex_buf = NULL;
}
ctx->Shared->NullBufferObj);
ASSERT(!exec->vtx.buffer_map);
- exec->vtx.buffer_map = (GLfloat *)ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE, 64);
+ exec->vtx.buffer_map = (GLfloat *)_mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
vbo_exec_vtxfmt_init( exec );
ASSERT(exec->vtx.bufferobj->Name == 0 ||
exec->vtx.bufferobj->Name == IMM_BUFFER_NAME);
if (exec->vtx.bufferobj->Name == 0) {
- ALIGN_FREE(exec->vtx.buffer_map);
+ _mesa_align_free(exec->vtx.buffer_map);
exec->vtx.buffer_map = NULL;
exec->vtx.buffer_ptr = NULL;
}