summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-18 11:49:04 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-11-18 11:49:04 +0400
commit03d178eef8acc2818ed4bfb684ebddbcf3cc98c6 (patch)
tree045ffad3b6435ed1a944a4940bc5f09a43bffc7c
parenta63d343fb7cf14dcd39ac607761d8addef512359 (diff)
parent31876d79fb6237e6d71932e48770e4ec1c4df064 (diff)
downloadbdwgc-03d178eef8acc2818ed4bfb684ebddbcf3cc98c6.tar.gz
Merge branch 'jtotz_bdwgc' into jtotz-bdwgc-intergration
Conflicts: configure.ac include/gc.h include/gc_cpp.h include/private/gcconfig.h misc.c tests/initsecondarythread.c tests/test_cpp.cc win32_threads.c
-rw-r--r--.hgignore2
-rw-r--r--.hgtags9
-rw-r--r--gc_cpp.cc81
-rw-r--r--include/gc.h83
-rw-r--r--include/gc_cpp.h119
-rw-r--r--include/private/gcconfig.h7
-rw-r--r--malloc.c8
-rw-r--r--mallocx.c2
-rw-r--r--misc.c28
-rw-r--r--tests/huge_test.c3
-rw-r--r--tests/test_cpp.cc2
-rw-r--r--vc9/libgc.vcproj489
-rw-r--r--vc9/test_cpp_libgc.vcproj293
-rw-r--r--vc9/test_huge.vcproj295
-rw-r--r--vc9/test_leak.vcproj295
-rw-r--r--vc9/test_libgc.vcproj289
-rw-r--r--win32_threads.c13
17 files changed, 1938 insertions, 80 deletions
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 00000000..2f5079db
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,2 @@
+# stuff from build system and ide
+glob:*.vcproj.*.user
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 00000000..7902ded5
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,9 @@
+052dc64d52d33f2e8cf2a6514d1f6176af89da67 gc7_1
+24a2e5b43a289dc9ba38fbde2b602c79c632ce03 gc7_2alpha6
+3c239e80bee0341c7834b5c5f85738c26da09f87 gc7_0
+43c85b2e652869da9de1058eb3e94b79c755941a gc7_0alpha7
+24a2e5b43a289dc9ba38fbde2b602c79c632ce03 gc7_2alpha6
+664dc1f702d2a4665b13964252fb63df0c58c93e start
+813e2af7cb1f3bffc43c54350847fa634b9a7e6a gc7_1alpha2
+de9672597e74978f9220b7b54c618b33a6d5c507 gc7_0alpha9
+e0ac59e6cd2913a15a9262cacc21576804a4abae gc7_2alpha2
diff --git a/gc_cpp.cc b/gc_cpp.cc
index 40153cb8..4573e766 100644
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -34,43 +34,44 @@ Authors: John R. Ellis and Jesse Hull
#include "gc_cpp.h"
-void* operator new( size_t size ) {
- return GC_MALLOC_UNCOLLECTABLE( size );}
-
-void operator delete( void* obj ) {
- GC_FREE( obj );}
-
-#ifdef GC_OPERATOR_NEW_ARRAY
-
-void* operator new[]( size_t size ) {
- return GC_MALLOC_UNCOLLECTABLE( size );}
-
-void operator delete[]( void* obj ) {
- GC_FREE( obj );}
-
-#endif /* GC_OPERATOR_NEW_ARRAY */
-
-#ifdef _MSC_VER
-
-// This new operator is used by VC++ in case of Debug builds !
-void* operator new( size_t size,
- int ,//nBlockUse,
- const char * szFileName,
- int nLine )
-{
-#ifndef GC_DEBUG
- return GC_malloc_uncollectable( size );
-#else
- return GC_debug_malloc_uncollectable(size, szFileName, nLine);
-#endif
-}
-
-#if _MSC_VER > 1020
-// This new operator is used by VC++ 7.0 and later in Debug builds.
-void* operator new[](size_t size, int nBlockUse, const char* szFileName, int nLine)
-{
- return operator new(size, nBlockUse, szFileName, nLine);
-}
-#endif
-
-#endif /* _MSC_VER */
+// MOVED TO HEADER!
+//void* operator new( size_t size ) {
+// return GC_MALLOC_UNCOLLECTABLE( size );}
+//
+//void operator delete( void* obj ) {
+// GC_FREE( obj );}
+//
+//#ifdef GC_OPERATOR_NEW_ARRAY
+//
+//void* operator new[]( size_t size ) {
+// return GC_MALLOC_UNCOLLECTABLE( size );}
+//
+//void operator delete[]( void* obj ) {
+// GC_FREE( obj );}
+//
+//#endif /* GC_OPERATOR_NEW_ARRAY */
+//
+//#ifdef _MSC_VER
+//
+//// This new operator is used by VC++ in case of Debug builds !
+//void* operator new( size_t size,
+// int ,//nBlockUse,
+// const char * szFileName,
+// int nLine )
+//{
+//#ifndef GC_DEBUG
+// return GC_malloc_uncollectable( size );
+//#else
+// return GC_debug_malloc_uncollectable(size, szFileName, nLine);
+//#endif
+//}
+//
+//#if _MSC_VER > 1020
+//// This new operator is used by VC++ 7.0 and later in Debug builds.
+//void* operator new[](size_t size, int nBlockUse, const char* szFileName, int nLine)
+//{
+// return operator new(size, nBlockUse, szFileName, nLine);
+//}
+//#endif
+//
+//#endif /* _MSC_VER */
diff --git a/include/gc.h b/include/gc.h
index ae7d046f..a0241822 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -28,6 +28,24 @@
* problems.
*/
+#define REDIRECT_MALLOC GC_MALLOC_UNCOLLECTABLE
+#define REDIRECT_FREE GC_FREE
+#define REDIRECT_REALLOC GC_REALLOC
+
+// the only mode that i support atm
+// so hardcode it here, no point in making it configurable
+#define GC_DLL
+#define GC_WIN32_THREADS
+// lets provide the equivalent of system's malloc()
+// this is useful if we force-include the gc but hack other libs
+// to be a bit more gc-aware
+#define ATOMIC_UNCOLLECTABLE
+
+// help debug mixed up preproc symbols
+#if (defined(WIN64) && !defined(_WIN64))
+#pragma message("Warning: Expecting _WIN64 for x64 targets! Notice the leading underscore!")
+#endif
+
#ifndef GC_H
#define GC_H
@@ -1232,12 +1250,41 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
# include <process.h> /* For _beginthreadex, _endthreadex */
# endif
-# include <windows.h>
# ifdef __cplusplus
extern "C" {
# endif
+#ifdef GC_BUILD
+# include <windows.h>
+#else
+ // copied from various windows header files
+ typedef void *HANDLE;
+ #define WINAPI __stdcall
+ typedef unsigned long DWORD;
+ typedef DWORD *LPDWORD;
+ typedef int BOOL;
+ #if defined(_WIN64)
+ typedef unsigned __int64 ULONG_PTR;
+ #else
+ typedef unsigned long ULONG_PTR;
+ #endif
+ typedef ULONG_PTR SIZE_T;
+
+ struct _SECURITY_ATTRIBUTES;
+ typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(void* lpThreadParameter);
+
+ __declspec(dllimport) HANDLE WINAPI CreateThread(
+ struct _SECURITY_ATTRIBUTES* lpThreadAttributes,
+ SIZE_T dwStackSize,
+ PTHREAD_START_ROUTINE lpStartAddress,
+ void* lpParameter,
+ DWORD dwCreationFlags,
+ DWORD* lpThreadId);
+
+ __declspec(dllimport) __declspec(noreturn) void WINAPI ExitThread(DWORD dwExitCode);
+#endif
+
# ifdef GC_UNDERSCORE_STDCALL
/* Explicitly prefix exported/imported WINAPI (__stdcall) symbols */
/* with '_' (underscore). Might be useful if MinGW/x86 is used. */
@@ -1256,15 +1303,15 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
/* terminate normally, or call GC_endthreadex() or GC_ExitThread, */
/* so that the thread is properly unregistered. */
GC_API HANDLE WINAPI GC_CreateThread(
- LPSECURITY_ATTRIBUTES /* lpThreadAttributes */,
- DWORD /* dwStackSize */,
- LPTHREAD_START_ROUTINE /* lpStartAddress */,
- LPVOID /* lpParameter */, DWORD /* dwCreationFlags */,
+ struct _SECURITY_ATTRIBUTES* /* lpThreadAttributes */,
+ SIZE_T /* dwStackSize */,
+ PTHREAD_START_ROUTINE /* lpStartAddress */,
+ void* /* lpParameter */, DWORD /* dwCreationFlags */,
LPDWORD /* lpThreadId */);
# ifndef DECLSPEC_NORETURN
/* Typically defined in winnt.h. */
-# define DECLSPEC_NORETURN /* empty */
+# define DECLSPEC_NORETURN __declspec(noreturn)
# endif
GC_API DECLSPEC_NORETURN void WINAPI GC_ExitThread(
@@ -1313,6 +1360,25 @@ GC_API void GC_CALL GC_register_has_static_roots_callback(
#endif /* GC_WIN32_THREADS */
+#ifdef REDIRECT_MALLOC
+// all the functions we redirect here need to have their header included
+// prior to macro def-ing! otherwise the headers will be included after gc.h has
+// been force-included and then we have two clashing symbols!
+#include <stdlib.h>
+#include <string.h>
+#ifdef __cplusplus
+#include <cstdlib>
+#include <cstring>
+#endif // __cplusplus
+#ifndef GC_BUILD
+#define free REDIRECT_FREE
+#define malloc REDIRECT_MALLOC
+#define calloc(n, lb) REDIRECT_MALLOC((n) * (lb))
+#define realloc(p, lb) REDIRECT_REALLOC((p), (lb))
+#define strdup GC_STRDUP
+#endif // GC_BUILD
+#endif // REDIRECT_MALLOC
+
/* Public setter and getter for switching "unmap as much as possible" */
/* mode on(1) and off(0). Has no effect unless unmapping is turned on. */
/* Has no effect on implicitly-initiated garbage collections. Initial */
@@ -1449,3 +1515,8 @@ GC_API void GC_CALL GC_win32_free_heap(void);
#endif
#endif /* GC_H */
+
+
+#ifdef __cplusplus
+#include "gc_cpp.h"
+#endif
diff --git a/include/gc_cpp.h b/include/gc_cpp.h
index 302fdc2d..4bee8dec 100644
--- a/include/gc_cpp.h
+++ b/include/gc_cpp.h
@@ -142,6 +142,8 @@ by UseGC. GC is an alias for UseGC, unless GC_NAME_CONFLICT is defined.
#include "gc.h"
+#ifdef __cplusplus
+
#ifndef THINK_CPLUS
# define GC_cdecl GC_CALLBACK
#else
@@ -168,11 +170,17 @@ by UseGC. GC is an alias for UseGC, unless GC_NAME_CONFLICT is defined.
# define GC_PLACEMENT_DELETE
#endif
-enum GCPlacement {UseGC,
+enum GCPlacement
+{
+ UseGC,
#ifndef GC_NAME_CONFLICT
- GC=UseGC,
+ GC=UseGC,
#endif
- NoGC, PointerFreeGC};
+ NoGC,
+ PointerFreeGC,
+ PointerFreeNoGC,
+ NoGCPointerFree = PointerFreeNoGC
+};
class gc {public:
inline void* operator new( size_t size );
@@ -255,21 +263,48 @@ inline void* operator new(
* There seems to be no way to redirect new in this environment without
* including this everywhere.
*/
-# if _MSC_VER > 1020
- void *operator new[]( size_t size );
+#if _MSC_VER > 1020
+_Ret_bytecap_(_Size) inline void *operator new[]( size_t size ){
+ return GC_MALLOC_UNCOLLECTABLE( size );}
- void operator delete[](void* obj);
-# endif
+inline void operator delete[]( void* obj ) {
+ GC_FREE( obj );}
+
+#endif
+
+
+// void* operator new( size_t size);
+// void operator delete(void* obj);
+
+ // MOVED HERE FROM gc_hpp.cc!
+ inline void* operator new(size_t size)
+ {
+ return GC_MALLOC_UNCOLLECTABLE(size);
+ }
- void* operator new(size_t size);
+ inline void operator delete(void* obj)
+ {
+ GC_FREE(obj);
+ }
- void operator delete(void* obj);
- // This new operator is used by VC++ in case of Debug builds !
- void* operator new( size_t size,
+ // This new operator is used by VC++ in case of Debug builds !
+_Ret_bytecap_(_Size) inline void* operator new( size_t size,
int ,//nBlockUse,
const char * szFileName,
- int nLine );
+ int nLine )
+ {
+#ifndef GC_DEBUG
+ return GC_malloc_uncollectable( size );
+#else
+ return GC_debug_malloc_uncollectable(size, szFileName, nLine);
+#endif
+ }
+_Ret_bytecap_(_Size) inline void* operator new[](size_t size, int nBlockUse, const char* szFileName, int nLine)
+{
+ return operator new(size, nBlockUse, szFileName, nLine);
+}
+
#endif /* _MSC_VER */
#ifdef GC_OPERATOR_NEW_ARRAY
@@ -293,13 +328,21 @@ Inline implementation
inline void* gc::operator new( size_t size ) {
return GC_MALLOC( size );}
-inline void* gc::operator new( size_t size, GCPlacement gcp ) {
- if (gcp == UseGC)
- return GC_MALLOC( size );
- else if (gcp == PointerFreeGC)
- return GC_MALLOC_ATOMIC( size );
- else
- return GC_MALLOC_UNCOLLECTABLE( size );}
+inline void* gc::operator new( size_t size, GCPlacement gcp )
+{
+ switch (gcp)
+ {
+ case UseGC:
+ return GC_MALLOC( size );
+ case PointerFreeGC:
+ return GC_MALLOC_ATOMIC( size );
+ case PointerFreeNoGC:
+ return GC_MALLOC_ATOMIC_UNCOLLECTABLE( size );
+ case NoGC:
+ default:
+ return GC_MALLOC_UNCOLLECTABLE( size );
+ }
+}
inline void* gc::operator new( size_t size, void *p ) {
return p;}
@@ -362,16 +405,30 @@ inline void* operator new(
{
void* obj;
- if (gcp == UseGC) {
+ if (gcp == UseGC)
+ {
obj = GC_MALLOC( size );
if (cleanup != 0)
GC_REGISTER_FINALIZER_IGNORE_SELF(
- obj, cleanup, clientData, 0, 0 );}
- else if (gcp == PointerFreeGC) {
- obj = GC_MALLOC_ATOMIC( size );}
- else {
- obj = GC_MALLOC_UNCOLLECTABLE( size );};
- return obj;}
+ obj, cleanup, clientData, 0, 0 );
+ }
+ else
+ if (gcp == PointerFreeGC)
+ {
+ obj = GC_MALLOC_ATOMIC( size );
+ }
+ else
+ if (gcp == PointerFreeNoGC)
+ {
+ obj = GC_MALLOC_ATOMIC_UNCOLLECTABLE( size );
+ }
+ else
+ {
+ obj = GC_MALLOC_UNCOLLECTABLE( size );
+ }
+
+ return obj;
+}
#ifdef GC_PLACEMENT_DELETE
inline void operator delete (
@@ -395,6 +452,14 @@ inline void* operator new(
}
#endif /* GC_OPERATOR_NEW_ARRAY */
+// oooohh... big hack (mainly for vnl which explicitly references mem-stuff via std namespace)
+namespace std
+{
+ using ::GC_debug_malloc_uncollectable;
+ using ::GC_debug_realloc;
+ using ::GC_realloc;
+ using ::GC_malloc_uncollectable;
+}
#if defined(__CYGWIN__)
# include <new> // for delete throw()
inline void operator delete(void *p)
@@ -403,4 +468,6 @@ inline void* operator new(
}
#endif
+#endif // __cplusplus
+
#endif /* GC_CPP_H */
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index a3600f11..81aa4b52 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -2662,9 +2662,10 @@
# error "One of STACK_GROWS_UP and STACK_GROWS_DOWN should be defd."
#endif
-#if defined(REDIRECT_MALLOC) && defined(THREADS) && !defined(LINUX)
-# error "REDIRECT_MALLOC with THREADS works at most on Linux."
-#endif
+# if defined(REDIRECT_MALLOC) && defined(THREADS) && !defined(LINUX)
+// FIXME: no idea if this is really true!
+//# error "REDIRECT_MALLOC with THREADS works at most on Linux."
+# endif
#ifdef GC_PRIVATE_H
/* This relies on some type definitions from gc_priv.h, from */
diff --git a/malloc.c b/malloc.c
index aeda6936..ec3881a9 100644
--- a/malloc.c
+++ b/malloc.c
@@ -327,6 +327,7 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb)
# define GC_debug_malloc_replacement(lb) \
GC_debug_malloc(lb, GC_DBG_RA "unknown", 0)
+#if 0
void * malloc(size_t lb)
{
/* It might help to manually inline the GC_malloc call here. */
@@ -344,6 +345,7 @@ void * malloc(size_t lb)
# endif /* I386 && GC_SOLARIS_THREADS */
return((void *)REDIRECT_MALLOC(lb));
}
+#endif
#if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
STATIC ptr_t GC_libpthread_start = 0;
@@ -369,6 +371,7 @@ void * malloc(size_t lb)
}
#endif /* GC_LINUX_THREADS */
+#if 0
void * calloc(size_t n, size_t lb)
{
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
@@ -392,7 +395,9 @@ void * calloc(size_t n, size_t lb)
# endif
return((void *)REDIRECT_MALLOC(n*lb));
}
+#endif
+#if 0
#ifndef strdup
char *strdup(const char *s)
{
@@ -409,6 +414,7 @@ void * calloc(size_t n, size_t lb)
/* If strdup is macro defined, we assume that it actually calls malloc, */
/* and thus the right thing will happen even without overriding it. */
/* This seems to be true on most Linux systems. */
+#endif
#ifndef strndup
/* This is similar to strdup(). */
@@ -539,7 +545,7 @@ GC_API void GC_CALL GC_free(void * p)
# define REDIRECT_FREE GC_free
#endif
-#ifdef REDIRECT_FREE
+#if 0//def REDIRECT_FREE
void free(void * p)
{
# if defined(GC_LINUX_THREADS) && !defined(USE_PROC_FOR_LIBRARIES)
diff --git a/mallocx.c b/mallocx.c
index d92014c9..1c3fd4ab 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -157,10 +157,12 @@ GC_API void * GC_CALL GC_realloc(void * p, size_t lb)
# define GC_debug_realloc_replacement(p, lb) \
GC_debug_realloc(p, lb, GC_DBG_RA "unknown", 0)
+#if 0
void * realloc(void * p, size_t lb)
{
return(REDIRECT_REALLOC(p, lb));
}
+#endif
# undef GC_debug_realloc_replacement
# endif /* REDIRECT_REALLOC */
diff --git a/misc.c b/misc.c
index ab3fef99..1be41d02 100644
--- a/misc.c
+++ b/misc.c
@@ -677,6 +677,34 @@ GC_API void GC_CALL GC_init(void)
# else
initial_heap_sz = (word)MINHINCR;
# endif
+
+#ifdef GC_DEBUG
+#ifndef _WIN64
+ {
+ // wow64: running 32-bit-gc on 64-bit-sys is broken!
+ // code copied from msdn docs example
+ typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
+ LPFN_ISWOW64PROCESS fnIsWow64Process = 0;
+ fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process");
+ if (NULL != fnIsWow64Process)
+ {
+ BOOL bIsWow64 = FALSE;
+ if (fnIsWow64Process(GetCurrentProcess(), &bIsWow64))
+ {
+ if (bIsWow64)
+ MessageBoxA(NULL,
+ "This program uses the BDWGC garbage collector compiled for 32-bit "
+ "but running on a 64-bit version of Windows.\n"
+ "This is known to be broken due to a design flaw in Windows itself! Expect erratic behaviour...",
+ "32-bit program running on 64-bit system",
+ MB_ICONWARNING | MB_OK);
+ }
+ }
+ }
+#endif
+#endif
+
+
DISABLE_CANCEL(cancel_state);
/* Note that although we are nominally called with the */
/* allocation lock held, the allocation lock is now */
diff --git a/tests/huge_test.c b/tests/huge_test.c
index bde9836d..dd58a8e7 100644
--- a/tests/huge_test.c
+++ b/tests/huge_test.c
@@ -28,7 +28,8 @@ int main(void)
/* That's OK. We test this corner case mostly to make sure that */
/* it fails predictably. */
GC_expand_hp(1024*1024*5);
- if (sizeof(long) == sizeof(void *)) {
+// if (sizeof(long) == sizeof(void *))
+ {
void *r = GC_MALLOC(LONG_MAX-1024);
if (0 != r) {
fprintf(stderr,
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc
index ce683af4..de01bf71 100644
--- a/tests/test_cpp.cc
+++ b/tests/test_cpp.cc
@@ -187,7 +187,7 @@ GC_word Disguise( void* p ) {
void* Undisguise( GC_word i ) {
return (void*) ~ i;}
-#ifdef MSWIN32
+#if 0//def MSWIN32
int APIENTRY WinMain(
HINSTANCE instance, HINSTANCE prev, LPSTR cmd, int cmdShow )
{
diff --git a/vc9/libgc.vcproj b/vc9/libgc.vcproj
new file mode 100644
index 00000000..c4c946c5
--- /dev/null
+++ b/vc9/libgc.vcproj
@@ -0,0 +1,489 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libgc"
+ ProjectGUID="{0478F0B4-D16F-40A8-B67F-8D0B7C22FC69}"
+ RootNamespace="libgc"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../libatomic_ops/src/"
+ PreprocessorDefinitions="GC_BUILD"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../libatomic_ops/src/"
+ PreprocessorDefinitions="GC_BUILD"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../libatomic_ops/src/"
+ PreprocessorDefinitions="GC_BUILD"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../libatomic_ops/src/"
+ PreprocessorDefinitions="GC_BUILD"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\allchblk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\alloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\backgraph.c"
+ >
+ </File>
+ <File
+ RelativePath="..\blacklst.c"
+ >
+ </File>
+ <File
+ RelativePath="..\checksums.c"
+ >
+ </File>
+ <File
+ RelativePath="..\dbg_mlc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\dyn_load.c"
+ >
+ </File>
+ <File
+ RelativePath="..\finalize.c"
+ >
+ </File>
+ <File
+ RelativePath="..\gc_cpp.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\gc_dlopen.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\headers.c"
+ >
+ </File>
+ <File
+ RelativePath="..\mach_dep.c"
+ >
+ </File>
+ <File
+ RelativePath="..\malloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\mallocx.c"
+ >
+ </File>
+ <File
+ RelativePath="..\mark.c"
+ >
+ </File>
+ <File
+ RelativePath="..\mark_rts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\misc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\new_hblk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\obj_map.c"
+ >
+ </File>
+ <File
+ RelativePath="..\os_dep.c"
+ >
+ </File>
+ <File
+ RelativePath="..\pcr_interface.c"
+ >
+ </File>
+ <File
+ RelativePath="..\ptr_chck.c"
+ >
+ </File>
+ <File
+ RelativePath="..\real_malloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\reclaim.c"
+ >
+ </File>
+ <File
+ RelativePath="..\specific.c"
+ >
+ </File>
+ <File
+ RelativePath="..\stubborn.c"
+ >
+ </File>
+ <File
+ RelativePath="..\thread_local_alloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\typd_mlc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\win32_threads.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\include\gc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\gc_allocator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\gc_cpp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\gc_typed.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/vc9/test_cpp_libgc.vcproj b/vc9/test_cpp_libgc.vcproj
new file mode 100644
index 00000000..b15c9e9f
--- /dev/null
+++ b/vc9/test_cpp_libgc.vcproj
@@ -0,0 +1,293 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="test_cpp_libgc"
+ ProjectGUID="{BF81A33A-2BD9-416B-9F4F-BB77774F490C}"
+ RootNamespace="test_cpp_libgc"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\tests\test_cpp.cc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/vc9/test_huge.vcproj b/vc9/test_huge.vcproj
new file mode 100644
index 00000000..8d9c091c
--- /dev/null
+++ b/vc9/test_huge.vcproj
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="test_huge"
+ ProjectGUID="{B3448331-ED22-47F5-914D-0C5C7E7BAB4C}"
+ RootNamespace="test_huge"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\tests\huge_test.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/vc9/test_leak.vcproj b/vc9/test_leak.vcproj
new file mode 100644
index 00000000..768b675f
--- /dev/null
+++ b/vc9/test_leak.vcproj
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="test_leak"
+ ProjectGUID="{7A56B41D-6B05-4BAF-A32E-CB6028E777E9}"
+ RootNamespace="test_leak"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_CONSOLE"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\tests\leak_test.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/vc9/test_libgc.vcproj b/vc9/test_libgc.vcproj
new file mode 100644
index 00000000..0f40c859
--- /dev/null
+++ b/vc9/test_libgc.vcproj
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="test_libgc"
+ ProjectGUID="{79CFC986-70F7-4254-880B-262F156C11A3}"
+ RootNamespace="test_libgc"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(solutiondir)/$(solutionname)_$(platformname).$(configurationname).vsprops"
+ CharacterSet="0"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="_WINDOWS"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\tests\test.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win32_threads.c b/win32_threads.c
index 0c841107..123668cf 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -156,7 +156,12 @@ GC_API void GC_CALL GC_use_threads_discovery(void)
ABORT("GC DllMain-based thread registration unsupported");
# else
/* Turn on GC_win32_dll_threads. */
- GC_ASSERT(!parallel_initialized);
+ // we dont need this assert here
+ // GC_init_parallel() does nothing if parallel_initialized==true
+ // also it breaks calling GC_use_DllMain() from DllMain()
+ // (because it gets called many times, during startup and shutdown)
+// GC_ASSERT(!parallel_initialized);
+
# ifndef GC_DISCOVER_TASK_THREADS
GC_win32_dll_threads = TRUE;
# endif
@@ -2058,7 +2063,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
- DWORD dwStackSize,
+ SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags,
LPDWORD lpThreadId)
@@ -2580,6 +2585,10 @@ GC_INNER void GC_thr_init(void)
# endif
static int entry_count = 0;
+ // despite the comment above
+ // this seems to work fine...
+ GC_use_threads_discovery();
+
if (!GC_win32_dll_threads && parallel_initialized) return TRUE;
switch (reason) {