]> granicus.if.org Git - gc/commitdiff
Revert the calloc() part of my patch.
authorMartin Baulig <martin@novell.com>
Sat, 20 May 2006 18:40:21 +0000 (18:40 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 11:28:02 +0000 (15:28 +0400)
svn path=/trunk/mono/; revision=60895

ChangeLog
pthread_support.c

index b960718dadc2278e7385e7ddabb68bfd3b70bfc8..0bc1298f9f081dbbbd78e35feb7d58b98d78a886 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        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>
 
index d0b004c56f392e3eef119fd124b7e57f3e2a6837..8ee8dfd04517e16abc4e3ca475cc9a0cd44a1b13 100644 (file)
@@ -626,7 +626,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;
@@ -658,7 +659,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            */
@@ -680,7 +681,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.      */
@@ -733,11 +734,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 */
 
@@ -1330,7 +1332,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);
@@ -1390,7 +1393,7 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
     }
     sem_destroy(&(si -> registered));
     LOCK();
-    free(si);
+    GC_INTERNAL_FREE(si);
     UNLOCK();
 
     return(result);