diff src/video/SDL_surface.c @ 1920:8a162bfdc838

Convert SDL_malloc to SDL_calloc if appropriate, slightly faster on operating systems which map the zero page for memory allocations. OpenGL renderer in progress
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Jul 2006 08:33:18 +0000
parents c121d94672cb
children 926294b2bb4e
line wrap: on
line diff
--- a/src/video/SDL_surface.c	Wed Jul 19 08:46:57 2006 +0000
+++ b/src/video/SDL_surface.c	Sat Jul 22 08:33:18 2006 +0000
@@ -42,12 +42,11 @@
     SDL_Surface *surface;
 
     /* Allocate the surface */
-    surface = (SDL_Surface *) SDL_malloc(sizeof(*surface));
+    surface = (SDL_Surface *) SDL_calloc(1, sizeof(*surface));
     if (surface == NULL) {
         SDL_OutOfMemory();
         return NULL;
     }
-    SDL_zerop(surface);
 
     surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
     if (!surface->format) {