Commit 1a4c0dacbcaae7f7aa462cb23296c2e8d6f88efc

Sam Lantinga 2014-05-10T11:27:43

Temporary fix for bug 2494 - Crashes due to the non thread-safe SDL_malloc/SDL_free on Windows We'll define USE_LOCKS as a temporary fix until an alternative like ptmalloc, jemalloc, or nedmalloc can be investigated. http://www.malloc.de/en/ http://www.canonware.com/jemalloc/ http://www.nedprod.com/programs/portable/nedmalloc/ SDL allocates memory very infrequently, so this is probably a decent fix for a while.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c
index 74105f5..0245622 100644
--- a/src/stdlib/SDL_malloc.c
+++ b/src/stdlib/SDL_malloc.c
@@ -54,6 +54,7 @@ void SDL_free(void *ptr)
 #define LACKS_STRING_H
 #define LACKS_STDLIB_H
 #define ABORT
+#define USE_LOCKS 1
 
 /*
   This is a version (aka dlmalloc) of malloc/free/realloc written by