src/stdlib/SDL_malloc.c
branchSDL-1.2
changeset 4061 95ecf165f113
parent 1465 8dfa9a6d69a5
child 4063 d634945c6172
equal deleted inserted replaced
4060:0b4ebec67cad 4061:95ecf165f113
   608 #ifndef MALLINFO_FIELD_TYPE
   608 #ifndef MALLINFO_FIELD_TYPE
   609 #define MALLINFO_FIELD_TYPE size_t
   609 #define MALLINFO_FIELD_TYPE size_t
   610 #endif  /* MALLINFO_FIELD_TYPE */
   610 #endif  /* MALLINFO_FIELD_TYPE */
   611 
   611 
   612 #define memset	SDL_memset
   612 #define memset	SDL_memset
   613 #define memcpy	SDL_memcpy
       
   614 #define malloc	SDL_malloc
   613 #define malloc	SDL_malloc
   615 #define calloc	SDL_calloc
   614 #define calloc	SDL_calloc
   616 #define realloc	SDL_realloc
   615 #define realloc	SDL_realloc
   617 #define free	SDL_free
   616 #define free	SDL_free
   618 
   617 
  3837     }
  3836     }
  3838     else {
  3837     else {
  3839       void* newmem = internal_malloc(m, bytes);
  3838       void* newmem = internal_malloc(m, bytes);
  3840       if (newmem != 0) {
  3839       if (newmem != 0) {
  3841         size_t oc = oldsize - overhead_for(oldp);
  3840         size_t oc = oldsize - overhead_for(oldp);
  3842         memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
  3841         SDL_memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
  3843         internal_free(m, oldmem);
  3842         internal_free(m, oldmem);
  3844       }
  3843       }
  3845       return newmem;
  3844       return newmem;
  3846     }
  3845     }
  3847   }
  3846   }