+2011-02-10 Ivan Maidanski <ivmai@mail.ru>
+
+ * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as
+ well.
+ * NT_STATIC_THREADS_MAKEFILE: Ditto.
+ * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine.
+ * include/gc.h (GC_INIT): Document.
+ * include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION,
+ GC_GETSECTBYNAME): Define depending only on the word size (i.e.,
+ define these macros also for ARM).
+ * tests/test.c (check_heap_stats): Print main thread stack bottom
+ as well (only if verbose mode is on).
+
2011-02-09 Ivan Maidanski <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)
* mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code
$(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj
.cpp.obj:
- $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP /Fo$*.obj
+ $(cc) $(cdebug) $(cflags) $(cvars) -Iinclude -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -D_CRT_SECURE_NO_DEPRECATE $*.CPP /Fo$*.obj
$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\private\msvc_dbg.h
$(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj
.cpp.obj:
- $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP -DGC_THREADS -DTHREAD_LOCAL_ALLOC /Fo$*.obj
+ $(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP -DGC_THREADS -DTHREAD_LOCAL_ALLOC -D_CRT_SECURE_NO_DEPRECATE $*.cpp /Fo$*.obj
$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\private\msvc_dbg.h
SN_TARGET_PS3 Compile for Sony PS/3.
USE_GET_STACKBASE_FOR_MAIN (Linux only) Use pthread_attr_getstack() instead
-of __libc_stack_end for getting the primordial thread stack base (useful if
-the client modifies the program's address space).
+of __libc_stack_end (or instead of any hard-coded value) for getting the
+primordial thread stack base (useful if the client modifies the program's
+address space).
# define GC_INIT_CONF_INITIAL_HEAP_SIZE /* empty */
#endif
+/* Portable clients should call this at the program start-up. More */
+/* over, some platforms require this call to be done strictly from the */
+/* primordial thread. */
#define GC_INIT() { GC_INIT_CONF_DONT_EXPAND; /* pre-init */ \
GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT; \
GC_INIT_CONF_MAX_RETRIES; \
# define GC_THREAD_STATE_T ppc_thread_state_t
# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
-# define GC_MACH_HEADER mach_header
-# define GC_MACH_SECTION section
-# define GC_GETSECTBYNAME getsectbynamefromheader
# else
# define GC_THREAD_STATE_T ppc_thread_state64_t
# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
-# define GC_MACH_HEADER mach_header_64
-# define GC_MACH_SECTION section_64
-# define GC_GETSECTBYNAME getsectbynamefromheader_64
# endif
# elif defined(I386) || defined(X86_64)
# if CPP_WORDSZ == 32
# define GC_THREAD_STATE_T x86_thread_state32_t
# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
-# define GC_MACH_HEADER mach_header
-# define GC_MACH_SECTION section
-# define GC_GETSECTBYNAME getsectbynamefromheader
# else
# define GC_THREAD_STATE_T x86_thread_state64_t
# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
-# define GC_MACH_HEADER mach_header_64
-# define GC_MACH_SECTION section_64
-# define GC_GETSECTBYNAME getsectbynamefromheader_64
# endif
# else
# if defined(ARM32)
# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
# endif
+
+# if CPP_WORDSZ == 32
+# define GC_MACH_HEADER mach_header
+# define GC_MACH_SECTION section
+# define GC_GETSECTBYNAME getsectbynamefromheader
+# else
+# define GC_MACH_HEADER mach_header_64
+# define GC_MACH_SECTION section_64
+# define GC_GETSECTBYNAME getsectbynamefromheader_64
+# endif
+
/* Try to work out the right way to access thread state structure */
/* members. The structure has changed its definition in different */
/* Darwin versions. This now defaults to the (older) names */
# endif
GC_invoke_finalizers();
}
+ if (GC_print_stats) {
+ GC_log_printf("Primordial thread stack bottom: %p\n",
+ GC_stackbottom);
+ }
(void)GC_printf("Completed %u tests\n", n_tests);
(void)GC_printf("Allocated %d collectable objects\n", collectable_count);
(void)GC_printf("Allocated %d uncollectable objects\n",