You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@@ -298,10 +298,6 @@ The following symbols have been renamed:
298
298
The following symbols have been removed:
299
299
* SDL_MIX_MAXVOLUME - mixer volume is now a float between 0.0 and 1.0
300
300
301
-
## SDL_clipboard.h
302
-
303
-
SDL_GetClipboardText() and SDL_GetPrimarySelectionText() return a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it.
304
-
305
301
## SDL_cpuinfo.h
306
302
307
303
The intrinsics headers (mmintrin.h, etc.) have been moved to `<SDL3/SDL_intrin.h>` and are no longer automatically included in SDL.h.
@@ -458,10 +454,6 @@ The following functions have been removed:
458
454
The following enums have been renamed:
459
455
* SDL_eventaction => SDL_EventAction
460
456
461
-
## SDL_filesystem.h
462
-
463
-
SDL_GetBasePath() and SDL_GetPrefPath() return a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it.
464
-
465
457
## SDL_gamecontroller.h
466
458
467
459
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.
@@ -710,15 +702,13 @@ Rather than iterating over haptic devices using device index, there is a new fun
@@ -850,6 +840,7 @@ Rather than iterating over joysticks using device index, there is a new function
850
840
SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n",
851
841
instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id));
852
842
}
843
+
SDL_free(joysticks);
853
844
}
854
845
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
855
846
}
@@ -1034,10 +1025,6 @@ The following symbols have been renamed:
1034
1025
1035
1026
SDL_LoadFunction() now returns `SDL_FunctionPointer` instead of `void *`, and should be cast to the appropriate function type. You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior.
1036
1027
1037
-
## SDL_locale.h
1038
-
1039
-
SDL_GetPreferredLocales() returns a const array of locale pointers, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it.
1040
-
1041
1028
## SDL_log.h
1042
1029
1043
1030
The following macros have been removed:
@@ -1588,7 +1575,7 @@ Rather than iterating over sensors using device index, there is a new function S
display, i, mode->w, mode->h, mode->pixel_density, mode->refresh_rate);
2050
2039
}
2040
+
SDL_free(modes);
2051
2041
}
2052
2042
}
2053
2043
```
@@ -2080,8 +2070,6 @@ SDL_WindowFlags is used instead of Uint32 for API functions that refer to window
2080
2070
2081
2071
SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter.
2082
2072
2083
-
SDL_GetWindowICCProfile() returns a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it.
0 commit comments