summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-23 17:18:04 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:59 +0200
commitd53b6dfbbb335dba60ef960e7e3abee10dcd9ed9 (patch)
tree9c96f158dcb673ad3b72b8731ccab7edbc8709c3 /os_dep.c
parentdff8113c399acf10ffc677a64cda68ffde2b9253 (diff)
2011-05-23 Ivan Maidanski <ivmai@mail.ru>
* mark.c (GC_dirty): Add prototype (only if MANUAL_VDB). * stubborn.c (GC_dirty): Ditto. * include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB, PROC_VDB): Undefine if MANUAL_VDB. * include/private/gcconfig.h (DEFAULT_VDB): Don't define if MANUAL_VDB. * os_dep.c (async_set_pht_entry_from_index): Define for MANUAL_VDB. * os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if success; if ioctl() failed then just print warning instead of aborting.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/os_dep.c b/os_dep.c
index c65d93a..21613d9 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -2850,6 +2850,9 @@ STATIC void GC_default_push_other_roots(void)
return(HDR(h) == 0 || get_pht_entry_from_index(GC_grungy_pages, index));
}
+# define async_set_pht_entry_from_index(db, index) \
+ set_pht_entry_from_index(db, index) /* for now */
+
/* Mark the page containing p as dirty. Logically, this dirties the */
/* entire object. */
void GC_dirty(ptr_t p)
@@ -3600,7 +3603,6 @@ GC_INNER void GC_dirty_init(void)
int fd;
char buf[30];
- GC_dirty_maintained = TRUE;
if (GC_bytes_allocd != 0 || GC_bytes_allocd_before_gc != 0) {
memset(GC_written_pages, 0xff, sizeof(page_hash_table));
if (GC_print_stats == VERBOSE)
@@ -3608,6 +3610,7 @@ GC_INNER void GC_dirty_init(void)
(unsigned long)(GC_bytes_allocd
+ GC_bytes_allocd_before_gc));
}
+
sprintf(buf, "/proc/%ld", (long)getpid());
fd = open(buf, O_RDONLY);
if (fd < 0) {
@@ -3617,8 +3620,11 @@ GC_INNER void GC_dirty_init(void)
close(fd);
syscall(SYS_fcntl, GC_proc_fd, F_SETFD, FD_CLOEXEC);
if (GC_proc_fd < 0) {
- ABORT("/proc ioctl failed");
+ WARN("/proc ioctl(PIOCOPENPD) failed", 0);
+ return;
}
+
+ GC_dirty_maintained = TRUE;
GC_proc_buf = GC_scratch_alloc(GC_proc_buf_size);
}