summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-02-16 19:05:31 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-02-16 22:14:59 +0100
commit7ec7f03cbfc351e5fd7a5c24d5f5fbb59063671a (patch)
treee34e3ac3c7c853f7ff05d9f775d6ba3a33702fd7 /os_dep.c
parent903df95c25f248701faa784b2dd98e681682e547 (diff)
Fix GC_finalizer_nested size to workaround alignment problem in Watcom
* finalize.c (GC_finalizer_nested): Change type from char to int to force GC symbols proper alignment for some compilers (e.g., Watcom); add comment. * finalize.c (GC_check_finalizer_nested): Cast GC_finalizer_nested properly (since it holds an unsigned char value). * os_dep.c (GC_get_maps): Remove static "init_buf" variable (of char size) and initialize "maps_buf" to NULL since it is allocated anyway (since maps_size is non-zero). * os_dep.c (GC_register_data_segments): Remove static "dummy" variable (of char size) and use GC_pages_executable instead.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/os_dep.c b/os_dep.c
index 15fa2c9..26ab892 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -200,8 +200,7 @@ GC_INNER char * GC_get_maps(void)
{
int f;
ssize_t result;
- static char init_buf[1];
- static char *maps_buf = init_buf;
+ static char *maps_buf = NULL;
static size_t maps_buf_sz = 1;
size_t maps_size, old_maps_size = 0;
@@ -1833,8 +1832,8 @@ void GC_register_data_segments(void)
void GC_register_data_segments(void)
{
# ifdef MSWIN32
- static char dummy;
- GC_register_root_section((ptr_t)(&dummy));
+ GC_register_root_section((ptr_t)&GC_pages_executable);
+ /* any other GC global variable would fit too. */
# endif
}