mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-27 15:09:11 +00:00
Removed temporary memory from the API
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this. So, we're largely going back to the original system, where the API returns allocated results and you free them. In addition, to solve the problems we originally wanted temporary memory for: * Short strings with a finite count, like device names, get stored in a per-thread string pool. * Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
This commit is contained in:
parent
21411c6418
commit
4f55271571
100 changed files with 737 additions and 853 deletions
|
@ -2584,7 +2584,7 @@ const char *SDL_GetAndroidInternalStoragePath(void)
|
|||
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
}
|
||||
return SDL_CreateTemporaryString(s_AndroidInternalFilesPath);
|
||||
return s_AndroidInternalFilesPath;
|
||||
}
|
||||
|
||||
Uint32 SDL_GetAndroidExternalStorageState(void)
|
||||
|
@ -2669,7 +2669,7 @@ const char *SDL_GetAndroidExternalStoragePath(void)
|
|||
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
}
|
||||
return SDL_CreateTemporaryString(s_AndroidExternalFilesPath);
|
||||
return s_AndroidExternalFilesPath;
|
||||
}
|
||||
|
||||
const char *SDL_GetAndroidCachePath(void)
|
||||
|
@ -2715,7 +2715,7 @@ const char *SDL_GetAndroidCachePath(void)
|
|||
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
}
|
||||
return SDL_CreateTemporaryString(s_AndroidCachePath);
|
||||
return s_AndroidCachePath;
|
||||
}
|
||||
|
||||
int SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue