Added functions to query and set the SDL memory allocation functions:

SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
This commit is contained in:
Sam Lantinga 2017-10-12 13:44:28 -07:00
parent 1887c54c68
commit 9c580e14c9
25 changed files with 311 additions and 68 deletions

View file

@ -561,16 +561,12 @@ SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
char *
SDL_strdup(const char *string)
{
#if defined(HAVE_STRDUP)
return strdup(string);
#else
size_t len = SDL_strlen(string) + 1;
char *newstr = SDL_malloc(len);
if (newstr) {
SDL_strlcpy(newstr, string, len);
}
return newstr;
#endif /* HAVE_STRDUP */
}
char *