*/
xmvis->vishandle = vinfo;
/* Allocate more space for additional visual */
- VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable,
- sizeof(XMesaVisual) * NumVisuals,
+ VisualTable = (XMesaVisual *) realloc( VisualTable,
sizeof(XMesaVisual) * (NumVisuals + 1));
/* add xmvis to the list */
VisualTable[NumVisuals] = xmvis;
*/
xmvis->vishandle = vinfo;
/* Allocate more space for additional visual */
- VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable,
- sizeof(XMesaVisual) * NumVisuals,
+ VisualTable = (XMesaVisual *) realloc( VisualTable,
sizeof(XMesaVisual) * (NumVisuals + 1));
/* add xmvis to the list */
VisualTable[NumVisuals] = xmvis;
#endif
}
-
-
-/** Reallocate memory */
-void *
-_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
-{
- const size_t copySize = (oldSize < newSize) ? oldSize : newSize;
- void *newBuffer = malloc(newSize);
- if (newBuffer && oldBuffer && copySize > 0)
- memcpy(newBuffer, oldBuffer, copySize);
- free(oldBuffer);
- return newBuffer;
-}
-
/*@}*/
extern void
_mesa_exec_free( void *addr );
-extern void *
-_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
-
#ifndef FFS_DEFINED
#define FFS_DEFINED 1
/* grow list */
shProg->Shaders = (struct gl_shader **)
- _mesa_realloc(shProg->Shaders,
- n * sizeof(struct gl_shader *),
- (n + 1) * sizeof(struct gl_shader *));
+ realloc(shProg->Shaders,
+ (n + 1) * sizeof(struct gl_shader *));
if (!shProg->Shaders) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader");
return;
struct prog_instruction *newInst;
newInst = (struct prog_instruction *)
- _mesa_realloc(oldInst,
- numOldInst * sizeof(struct prog_instruction),
- numNewInst * sizeof(struct prog_instruction));
+ realloc(oldInst,
+ numNewInst * sizeof(struct prog_instruction));
return newInst;
}
/* realloc arrays */
paramList->Parameters = (struct gl_program_parameter *)
- _mesa_realloc(paramList->Parameters,
- oldNum * sizeof(struct gl_program_parameter),
- paramList->Size * sizeof(struct gl_program_parameter));
+ realloc(paramList->Parameters,
+ paramList->Size * sizeof(struct gl_program_parameter));
paramList->ParameterValues = (gl_constant_value (*)[4])
_mesa_align_realloc(paramList->ParameterValues, /* old buf */