+2008-10-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
+ * thread_local_alloc.c, include/private/thread_local_alloc.h:
+ Fix typos in comments.
+ * finalize.c: Declare mark_procs and GC_register_finalizer_inner
+ STATIC.
+ * malloc.c (GC_free): Move size calculation below assertion.
+
2008-10-27 Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
struct disappearing_link * new_dl;
DCL_LOCK_STATE;
- if ((word)link & (ALIGNMENT-1))
+ if (((word)link & (ALIGNMENT-1)) || link == NULL)
ABORT("Bad arg to GC_general_register_disappearing_link");
# ifdef THREADS
LOCK();
/* Possible finalization_marker procedures. Note that mark stack */
/* overflow is handled by the caller, and is not a disaster. */
-GC_API void GC_normal_finalize_mark_proc(ptr_t p)
+STATIC void GC_normal_finalize_mark_proc(ptr_t p)
{
hdr * hhdr = HDR(p);
/* This only pays very partial attention to the mark descriptor. */
/* It does the right thing for normal and atomic objects, and treats */
/* most others as normal. */
-GC_API void GC_ignore_self_finalize_mark_proc(ptr_t p)
+STATIC void GC_ignore_self_finalize_mark_proc(ptr_t p)
{
hdr * hhdr = HDR(p);
word descr = hhdr -> hb_descr;
}
/*ARGSUSED*/
-GC_API void GC_null_finalize_mark_proc(ptr_t p)
+STATIC void GC_null_finalize_mark_proc(ptr_t p)
{
}
/* behavior. Objects registered in this way are not finalized */
/* if they are reachable by other finalizable objects, eve if those */
/* other objects specify no ordering. */
-GC_API void GC_unreachable_finalize_mark_proc(ptr_t p)
+STATIC void GC_unreachable_finalize_mark_proc(ptr_t p)
{
GC_normal_finalize_mark_proc(p);
}
/* marking for finalization ordering. Any objects marked */
/* by that procedure will be guaranteed to not have been */
/* finalized when this finalizer is invoked. */
-GC_API void GC_register_finalizer_inner(void * obj,
+STATIC void GC_register_finalizer_inner(void * obj,
GC_finalization_proc fn, void *cd,
GC_finalization_proc *ofn, void **ocd,
finalization_mark_proc mp)
/* The thread support layer must arrange to mark thread-local */
/* free lists explicitly, since the link field is often */
-/* invisible to the marker. It knows hoe to find all threads; */
+/* invisible to the marker. It knows how to find all threads; */
/* we take care of an individual thread freelist structure. */
void GC_mark_thread_local_fls_for(GC_tlfs p);
# endif
h = HBLKPTR(p);
hhdr = HDR(h);
- sz = hhdr -> hb_sz;
- ngranules = BYTES_TO_GRANULES(sz);
# if defined(REDIRECT_MALLOC) && \
(defined(GC_SOLARIS_THREADS) || defined(GC_LINUX_THREADS) \
|| defined(MSWIN32))
if (0 == hhdr) return;
# endif
GC_ASSERT(GC_base(p) == p);
+ sz = hhdr -> hb_sz;
+ ngranules = BYTES_TO_GRANULES(sz);
knd = hhdr -> hb_obj_kind;
ok = &GC_obj_kinds[knd];
if (EXPECT((ngranules <= MAXOBJGRANULES), 1)) {
/* The thread support layer must arrange to mark thread-local */
/* free lists explicitly, since the link field is often */
-/* invisible to the marker. It knows hoe to find all threads; */
+/* invisible to the marker. It knows how to find all threads; */
/* we take care of an individual thread freelist structure. */
void GC_mark_thread_local_fls_for(GC_tlfs p)
{