mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 09:48:26 +00:00
Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions() SDL_SetMemoryFunctions() SDL_GetNumAllocations()
This commit is contained in:
parent
1887c54c68
commit
9c580e14c9
25 changed files with 311 additions and 68 deletions
|
@ -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 *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue