55 lines
2.0 KiB
Diff
55 lines
2.0 KiB
Diff
|
--- src/gc-core.h.old 2013-12-31 01:22:38.976653890 +0400
|
||
|
+++ src/gc-core.h 2013-12-31 01:22:48.525653608 +0400
|
||
|
@@ -57,7 +57,7 @@
|
||
|
CleanupFunc *old_func,
|
||
|
void **old_data);
|
||
|
int (*general_register_disappearing_link)(void **p_ptr,
|
||
|
- void *base);
|
||
|
+ const void *base);
|
||
|
int (*unregister_disappearing_link)(void **p_ptr);
|
||
|
std::size_t (*get_heap_size)();
|
||
|
std::size_t (*get_free_bytes)();
|
||
|
--- src/gc.cpp.old 2013-12-31 01:23:50.462651778 +0400
|
||
|
+++ src/gc.cpp 2013-12-31 01:40:37.718622017 +0400
|
||
|
@@ -70,8 +70,8 @@
|
||
|
return base + debug_base_fixup();
|
||
|
}
|
||
|
|
||
|
-int debug_general_register_disappearing_link(void **p_ptr, void *base) {
|
||
|
- char *real_base=reinterpret_cast<char *>(base) - debug_base_fixup();
|
||
|
+int debug_general_register_disappearing_link(void **p_ptr, const void *base) {
|
||
|
+ char *real_base=const_cast<char *>(reinterpret_cast<const char *>(base)) - debug_base_fixup();
|
||
|
return GC_general_register_disappearing_link(p_ptr, real_base);
|
||
|
}
|
||
|
|
||
|
@@ -90,7 +90,7 @@
|
||
|
}
|
||
|
}
|
||
|
|
||
|
-int dummy_general_register_disappearing_link(void **, void *) { return false; }
|
||
|
+int dummy_general_register_disappearing_link(void **, const void *) { return false; }
|
||
|
|
||
|
int dummy_unregister_disappearing_link(void **/*link*/) { return false; }
|
||
|
|
||
|
@@ -112,7 +112,11 @@
|
||
|
&GC_malloc_atomic_uncollectable,
|
||
|
&GC_base,
|
||
|
&GC_register_finalizer_ignore_self,
|
||
|
+#if (GC_MAJOR_VERSION >= 7 && GC_MINOR_VERSION >= 4)
|
||
|
&GC_general_register_disappearing_link,
|
||
|
+#else
|
||
|
+ (int (*)(void**, const void*))(&GC_general_register_disappearing_link),
|
||
|
+#endif
|
||
|
&GC_unregister_disappearing_link,
|
||
|
&GC_get_heap_size,
|
||
|
&GC_get_free_bytes,
|
||
|
@@ -202,7 +206,7 @@
|
||
|
die_because_not_initialized();
|
||
|
}
|
||
|
|
||
|
-int stub_general_register_disappearing_link(void **, void *) {
|
||
|
+int stub_general_register_disappearing_link(void **, const void *) {
|
||
|
die_because_not_initialized();
|
||
|
return 0;
|
||
|
}
|