diff options
author | Richard Levitte <levitte@openssl.org> | 2000-06-01 22:19:21 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-06-01 22:19:21 +0000 |
commit | 26a3a48d65c7464b400ec1de439994d7f0d25fed (patch) | |
tree | 91abb7d351b174e58f60e5353b731b916eaf0c5c /crypto/threads | |
parent | de42b6a7a82be33d2976ab605e74d7bc95b71447 (diff) |
There have been a number of complaints from a number of sources that names
like Malloc, Realloc and especially Free conflict with already existing names
on some operating systems or other packages. That is reason enough to change
the names of the OpenSSL memory allocation macros to something that has a
better chance of being unique, like prepending them with OPENSSL_.
This change includes all the name changes needed throughout all C files.
Diffstat (limited to 'crypto/threads')
-rw-r--r-- | crypto/threads/mttest.c | 24 | ||||
-rw-r--r-- | crypto/threads/th-lock.c | 26 |
2 files changed, 25 insertions, 25 deletions
diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index 24713a3157..100165948c 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -699,7 +699,7 @@ void thread_setup(void) { int i; - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(HANDLE)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(HANDLE)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_cs[i]=CreateMutex(NULL,FALSE,NULL); @@ -716,7 +716,7 @@ void thread_cleanup(void) CRYPTO_set_locking_callback(NULL); for (i=0; i<CRYPTO_num_locks(); i++) CloseHandle(lock_cs[i]); - Free(lock_cs); + OPENSSL_free(lock_cs); } void win32_locking_callback(int mode, int type, char *file, int line) @@ -794,8 +794,8 @@ void thread_setup(void) { int i; - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(mutex_t)); - lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_count[i]=0; @@ -821,8 +821,8 @@ void thread_cleanup(void) mutex_destroy(&(lock_cs[i])); fprintf(stderr,"%8ld:%s\n",lock_count[i],CRYPTO_get_lock_name(i)); } - Free(lock_cs); - Free(lock_count); + OPENSSL_free(lock_cs); + OPENSSL_free(lock_count); fprintf(stderr,"done cleanup\n"); @@ -919,7 +919,7 @@ void thread_setup(void) arena=usinit(filename); unlink(filename); - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(usema_t *)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_cs[i]=usnewsema(arena,1); @@ -942,7 +942,7 @@ void thread_cleanup(void) usdumpsema(lock_cs[i],stdout,buf); usfreesema(lock_cs[i],arena); } - Free(lock_cs); + OPENSSL_free(lock_cs); } void irix_locking_callback(int mode, int type, char *file, int line) @@ -1002,8 +1002,8 @@ void thread_setup(void) { int i; - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); - lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_count[i]=0; @@ -1026,8 +1026,8 @@ void thread_cleanup(void) fprintf(stderr,"%8ld:%s\n",lock_count[i], CRYPTO_get_lock_name(i)); } - Free(lock_cs); - Free(lock_count); + OPENSSL_free(lock_cs); + OPENSSL_free(lock_count); fprintf(stderr,"done cleanup\n"); } diff --git a/crypto/threads/th-lock.c b/crypto/threads/th-lock.c index 3ee978060c..553d2218de 100644 --- a/crypto/threads/th-lock.c +++ b/crypto/threads/th-lock.c @@ -113,7 +113,7 @@ void CRYPTO_thread_setup(void) { int i; - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(HANDLE)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(HANDLE)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_cs[i]=CreateMutex(NULL,FALSE,NULL); @@ -131,7 +131,7 @@ static void CRYPTO_thread_cleanup(void) CRYPTO_set_locking_callback(NULL); for (i=0; i<CRYPTO_num_locks(); i++) CloseHandle(lock_cs[i]); - Free(lock_cs); + OPENSSL_free(lock_cs); } void win32_locking_callback(int mode, int type, char *file, int line) @@ -164,11 +164,11 @@ void CRYPTO_thread_setup(void) int i; #ifdef USE_MUTEX - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(mutex_t)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t)); #else - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(rwlock_t)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(rwlock_t)); #endif - lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_count[i]=0; @@ -196,8 +196,8 @@ void CRYPTO_thread_cleanup(void) rwlock_destroy(&(lock_cs[i])); #endif } - Free(lock_cs); - Free(lock_count); + OPENSSL_free(lock_cs); + OPENSSL_free(lock_count); } void solaris_locking_callback(int mode, int type, char *file, int line) @@ -267,7 +267,7 @@ void CRYPTO_thread_setup(void) arena=usinit(filename); unlink(filename); - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(usema_t *)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_cs[i]=usnewsema(arena,1); @@ -290,7 +290,7 @@ void CRYPTO_thread_cleanup(void) usdumpsema(lock_cs[i],stdout,buf); usfreesema(lock_cs[i],arena); } - Free(lock_cs); + OPENSSL_free(lock_cs); } void irix_locking_callback(int mode, int type, char *file, int line) @@ -324,8 +324,8 @@ void CRYPTO_thread_setup(void) { int i; - lock_cs=Malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); - lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); for (i=0; i<CRYPTO_num_locks(); i++) { lock_count[i]=0; @@ -345,8 +345,8 @@ void thread_cleanup(void) { pthread_mutex_destroy(&(lock_cs[i])); } - Free(lock_cs); - Free(lock_count); + OPENSSL_free(lock_cs); + OPENSSL_free(lock_count); } void pthreads_locking_callback(int mode, int type, char *file, |