Select the types of activity you want to include in your feed.
Redefined malloc and free (as SDL_malloc and SDL_free) for stb-image so that I can safely let SDL handle the pixel memory. Also replaced all internal mallocs and frees in SDL_gpu for consistency.
···1122#define STB_IMAGE_IMPLEMENTATION
33+44+// Make stb-image use SDL's allocator so we can let SDL handle the memory that stb allocates.
55+// To do this, we'll redefine malloc and free.
66+#include "SDL.h"
77+#include <stdlib.h>
88+#undef malloc
99+#undef free
1010+#define malloc SDL_malloc
1111+#define free SDL_free
1212+313#include "stb_image.h"
+11
src/externals/stb_image/stb_image_write.c
···1122#define STB_IMAGE_WRITE_IMPLEMENTATION
33+44+// stbi_write_png_to_mem() returns a malloc'ed array,
55+// so let's do the same thing as done with stb_image.c so it is more compatible with SDL's allocator.
66+#include "SDL.h"
77+#include <stdlib.h>
88+#undef malloc
99+#undef free
1010+#define malloc SDL_malloc
1111+#define free SDL_free
1212+1313+314#include "stb_image_write.h"