341 |
GC_API void GC_add_roots GC_PROTO((char * low_address, |
GC_API void GC_add_roots GC_PROTO((char * low_address, |
342 |
char * high_address_plus_1)); |
char * high_address_plus_1)); |
343 |
|
|
344 |
|
/* Remove a root segment. Wizards only. */ |
345 |
|
GC_API void GC_remove_roots GC_PROTO((char * low_address, |
346 |
|
char * high_address_plus_1)); |
347 |
|
|
348 |
/* Add a displacement to the set of those considered valid by the */ |
/* Add a displacement to the set of those considered valid by the */ |
349 |
/* collector. GC_register_displacement(n) means that if p was returned */ |
/* collector. GC_register_displacement(n) means that if p was returned */ |
350 |
/* by GC_malloc, then (char *)p + n will be considered to be a valid */ |
/* by GC_malloc, then (char *)p + n will be considered to be a valid */ |
351 |
/* pointer to n. N must be small and less than the size of p. */ |
/* pointer to p. N must be small and less than the size of p. */ |
352 |
/* (All pointers to the interior of objects from the stack are */ |
/* (All pointers to the interior of objects from the stack are */ |
353 |
/* considered valid in any case. This applies to heap objects and */ |
/* considered valid in any case. This applies to heap objects and */ |
354 |
/* static data.) */ |
/* static data.) */ |
355 |
/* Preferably, this should be called before any other GC procedures. */ |
/* Preferably, this should be called before any other GC procedures. */ |
356 |
/* Calling it later adds to the probability of excess memory */ |
/* Calling it later adds to the probability of excess memory */ |
357 |
/* retention. */ |
/* retention. */ |
358 |
/* This is a no-op if the collector was compiled with recognition of */ |
/* This is a no-op if the collector has recognition of */ |
359 |
/* arbitrary interior pointers enabled, which is now the default. */ |
/* arbitrary interior pointers enabled, which is now the default. */ |
360 |
GC_API void GC_register_displacement GC_PROTO((GC_word n)); |
GC_API void GC_register_displacement GC_PROTO((GC_word n)); |
361 |
|
|
876 |
|
|
877 |
#endif /* THREADS && !SRC_M3 */ |
#endif /* THREADS && !SRC_M3 */ |
878 |
|
|
879 |
#if defined(GC_WIN32_THREADS) |
#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) |
880 |
# include <windows.h> |
# include <windows.h> |
|
# include <winbase.h> |
|
881 |
|
|
882 |
/* |
/* |
883 |
* All threads must be created using GC_CreateThread, so that they will be |
* All threads must be created using GC_CreateThread, so that they will be |
886 |
* and does then use DllMain to keep track of thread creations. But new code |
* and does then use DllMain to keep track of thread creations. But new code |
887 |
* should be built to call GC_CreateThread. |
* should be built to call GC_CreateThread. |
888 |
*/ |
*/ |
889 |
HANDLE WINAPI GC_CreateThread( |
GC_API HANDLE GC_CreateThread( |
890 |
LPSECURITY_ATTRIBUTES lpThreadAttributes, |
LPSECURITY_ATTRIBUTES lpThreadAttributes, |
891 |
DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, |
DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, |
892 |
LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ); |
LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ); |
908 |
# endif |
# endif |
909 |
# endif /* defined(_WIN32_WCE) */ |
# endif /* defined(_WIN32_WCE) */ |
910 |
|
|
911 |
#endif /* defined(GC_WIN32_THREADS) */ |
#endif /* defined(GC_WIN32_THREADS) && !cygwin */ |
912 |
|
|
913 |
/* |
/* |
914 |
* If you are planning on putting |
* If you are planning on putting |
920 |
# define GC_INIT() { extern end, etext; \ |
# define GC_INIT() { extern end, etext; \ |
921 |
GC_noop(&end, &etext); } |
GC_noop(&end, &etext); } |
922 |
#else |
#else |
923 |
# if defined(__CYGWIN32__) && defined(GC_USE_DLL) || defined (_AIX) |
# if defined(__CYGWIN32__) && defined(GC_DLL) || defined (_AIX) |
924 |
/* |
/* |
925 |
* Similarly gnu-win32 DLLs need explicit initialization from |
* Similarly gnu-win32 DLLs need explicit initialization from |
926 |
* the main program, as does AIX. |
* the main program, as does AIX. |
927 |
*/ |
*/ |
928 |
# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } |
# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); } |
929 |
# else |
# else |
930 |
|
# if defined(__APPLE__) && defined(__MACH__) |
931 |
|
# define GC_INIT() { GC_init(); } |
932 |
|
# else |
933 |
# define GC_INIT() |
# define GC_INIT() |
934 |
|
# endif |
935 |
# endif |
# endif |
936 |
#endif |
#endif |
937 |
|
|