diff src/thread/amigaos/SDL_thread.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents c9b51268668f
children 604d73db6802
line wrap: on
line diff
--- a/src/thread/amigaos/SDL_thread.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/thread/amigaos/SDL_thread.c	Tue Feb 07 06:59:48 2006 +0000
@@ -84,16 +84,16 @@
 			SDL_numthreads, SDL_maxthreads);
 #endif
 	if ( SDL_numthreads == SDL_maxthreads ) {
-		threads=(SDL_Thread **)malloc((SDL_maxthreads+ARRAY_CHUNKSIZE)*
+		threads=(SDL_Thread **)SDL_malloc((SDL_maxthreads+ARRAY_CHUNKSIZE)*
 		                              (sizeof *threads));
 		if ( threads == NULL ) {
 			SDL_OutOfMemory();
 			goto done;
 		}
-		memcpy(threads, SDL_Threads, SDL_numthreads*(sizeof *threads));
+		SDL_memcpy(threads, SDL_Threads, SDL_numthreads*(sizeof *threads));
 		SDL_maxthreads += ARRAY_CHUNKSIZE;
 		if ( SDL_Threads ) {
-			free(SDL_Threads);
+			SDL_free(SDL_Threads);
 		}
 		SDL_Threads = threads;
 	}
@@ -198,19 +198,19 @@
 	int ret;
 
 	/* Allocate memory for the thread info structure */
-	thread = (SDL_Thread *)malloc(sizeof(*thread));
+	thread = (SDL_Thread *)SDL_malloc(sizeof(*thread));
 	if ( thread == NULL ) {
 		SDL_OutOfMemory();
 		return(NULL);
 	}
-	memset(thread, 0, (sizeof *thread));
+	SDL_memset(thread, 0, (sizeof *thread));
 	thread->status = -1;
 
 	/* Set up the arguments for the thread */
-	args = (thread_args *)malloc(sizeof(*args));
+	args = (thread_args *)SDL_malloc(sizeof(*args));
 	if ( args == NULL ) {
 		SDL_OutOfMemory();
-		free(thread);
+		SDL_free(thread);
 		return(NULL);
 	}
 	args->func = fn;
@@ -218,8 +218,8 @@
 	args->info = thread;
 	args->wait = FindTask(NULL);
 	if ( args->wait == NULL ) {
-		free(thread);
-		free(args);
+		SDL_free(thread);
+		SDL_free(args);
 		SDL_OutOfMemory();
 		return(NULL);
 	}
@@ -239,10 +239,10 @@
 	} else {
 		/* Oops, failed.  Gotta free everything */
 		SDL_DelThread(thread);
-		free(thread);
+		SDL_free(thread);
 		thread = NULL;
 	}
-	free(args);
+	SDL_free(args);
 
 	/* Everything is running now */
 	return(thread);
@@ -256,7 +256,7 @@
 			*status = thread->status;
 		}
 		SDL_DelThread(thread);
-		free(thread);
+		SDL_free(thread);
 	}
 }