diff options
author | Martin Baulig <martin@novell.com> | 2006-05-20 22:40:21 +0400 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2006-05-20 22:40:21 +0400 |
commit | 66c98d0ab0fc4ab7ee1c726b7308bcb082e5c37c (patch) | |
tree | bb3a31fd007163945b1c8d0da2f0411a347b4a05 /libgc | |
parent | bc635c03df25b68d1a2b670578f970dcbbc23987 (diff) |
Revert the calloc() part of my patch.
svn path=/trunk/mono/; revision=60895
Diffstat (limited to 'libgc')
-rw-r--r-- | libgc/ChangeLog | 5 | ||||
-rw-r--r-- | libgc/pthread_support.c | 15 |
2 files changed, 10 insertions, 10 deletions
diff --git a/libgc/ChangeLog b/libgc/ChangeLog index 42ad1ca0b8f..ac2fd1f843c 100644 --- a/libgc/ChangeLog +++ b/libgc/ChangeLog @@ -25,12 +25,9 @@ any function in it be NULL; use NULL as the default vtable. (GC_mono_debugger_add_all_threads): New public function. - * pthread_support.c (GC_new_thread): Use calloc() instead of - GC_INTERNAL_MALLOC() to allocate the `GC_thread' structure. + * pthread_support.c (GC_delete_thread): Call `gc_thread_vtable->thread_exited()'. (GC_thr_init): Call `gc_thread_vtable->thread_created()'. - (GC_start_routine_head): Likewise; use calloc() instead of - GC_INTERNAL_MALLOC() to allocate the `start_info'. 2006-04-05 Zoltan Varga <vargaz@gmail.com> diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index ecb07ffd4e2..e2fef71968d 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -667,7 +667,8 @@ GC_thread GC_new_thread(pthread_t id) result = &first_thread; first_thread_used = TRUE; } else { - result = calloc (1, sizeof (struct GC_Thread_Rep)); + result = (struct GC_Thread_Rep *) + GC_INTERNAL_MALLOC(sizeof(struct GC_Thread_Rep), NORMAL); } if (result == 0) return(0); result -> id = id; @@ -699,7 +700,7 @@ void GC_delete_thread(pthread_t id) if (gc_thread_vtable && gc_thread_vtable->thread_exited) gc_thread_vtable->thread_exited (id, &p->stop_info.stack_ptr); #endif - free(p); + GC_INTERNAL_FREE(p); } /* If a thread has been joined, but we have not yet */ @@ -721,7 +722,7 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id) } else { prev -> next = p -> next; } - free(p); + GC_INTERNAL_FREE(p); } /* Return a GC_thread corresponding to a given pthread_t. */ @@ -774,11 +775,12 @@ void GC_remove_all_threads_but_me(void) GC_destroy_thread_local(p); } # endif /* THREAD_LOCAL_ALLOC */ - if (p != &first_thread) free(p); + if (p != &first_thread) GC_INTERNAL_FREE(p); } } GC_threads[hv] = me; } + GC_INTERNAL_FREE(p); } #endif /* HANDLE_FORK */ @@ -1371,7 +1373,8 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread, /* responsibility. */ LOCK(); - si = calloc (1, sizeof (struct start_info)); + si = (struct start_info *)GC_INTERNAL_MALLOC(sizeof(struct start_info), + NORMAL); UNLOCK(); if (!parallel_initialized) GC_init_parallel(); if (0 == si) return(ENOMEM); @@ -1431,7 +1434,7 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread, } sem_destroy(&(si -> registered)); LOCK(); - free(si); + GC_INTERNAL_FREE(si); UNLOCK(); return(result); |