Skip to content
Browse files

Fix compiling with SGEN_BINARY_PROTOCOL.

  • Loading branch information...
1 parent f6a5608 commit ee0bc0d1761d2a528b0c1a9fecc196deb01a5d44 @vargaz vargaz committed Oct 14, 2012
Showing with 11 additions and 3 deletions.
  1. +2 −1 mono/metadata/sgen-gc.c
  2. +7 −0 mono/metadata/sgen-protocol.c
  3. +2 −2 mono/metadata/sgen-ssb.c
View
3 mono/metadata/sgen-gc.c
@@ -2699,7 +2699,7 @@ major_do_collection (const char *reason)
GCRootReport report;
report.count = 0;
if (sgen_find_optimized_pin_queue_area (bigobj->data, (char*)bigobj->data + bigobj->size, &dummy)) {
- binary_protocol_pin (bigobj->data, (gpointer)LOAD_VTABLE (bigobj->data), safe_object_get_size (bigobj->data));
+ binary_protocol_pin (bigobj->data, (gpointer)LOAD_VTABLE (bigobj->data), safe_object_get_size (((MonoObject*)(bigobj->data))));
if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
MonoVTable *vt = (MonoVTable*)LOAD_VTABLE (bigobj->data);
MONO_GC_OBJ_PINNED ((mword)bigobj->data, sgen_safe_object_get_size ((MonoObject*)bigobj->data), vt->klass->name_space, vt->klass->name, GENERATION_OLD);
@@ -4193,6 +4193,7 @@ mono_gc_wbarrier_value_copy (gpointer dest, gpointer src, int count, MonoClass *
#ifdef SGEN_BINARY_PROTOCOL
{
+ size_t element_size = mono_class_value_size (klass, NULL);
int i;
for (i = 0; i < count; ++i) {
scan_object_for_binary_protocol_copy_wbarrier ((char*)dest + i * element_size,
View
7 mono/metadata/sgen-protocol.c
@@ -22,8 +22,13 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_SGEN_GC
+
#include "config.h"
+#include "sgen-gc.h"
#include "sgen-protocol.h"
+#include "sgen-memory-governor.h"
+#include "utils/mono-mmap.h"
#ifdef SGEN_BINARY_PROTOCOL
@@ -265,3 +270,5 @@ binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offset, g
}
#endif
+
+#endif /* HAVE_SGEN_GC */
View
4 mono/metadata/sgen-ssb.c
@@ -419,7 +419,7 @@ handle_remset (mword *p, void *start_nursery, void *end_nursery, gboolean global
sgen_get_current_object_ops ()->copy_or_mark_object (ptr, queue);
DEBUG (9, fprintf (gc_debug_file, "Overwrote remset at %p with %p\n", ptr, *ptr));
if (old)
- binary_protocol_ptr_update (ptr, old, *ptr, (gpointer)LOAD_VTABLE (*ptr), sgen_safe_object_get_size (*ptr));
+ binary_protocol_ptr_update (ptr, old, *ptr, (gpointer)SGEN_LOAD_VTABLE (*ptr), sgen_safe_object_get_size (*ptr));
if (!global && *ptr >= start_nursery && *ptr < end_nursery) {
/*
* If the object is pinned, each reference to it from nonpinned objects
@@ -752,7 +752,7 @@ sgen_ssb_record_pointer (gpointer ptr)
sgen_pin_stats_register_global_remset (obj);
DEBUG (8, fprintf (gc_debug_file, "Adding global remset for %p\n", ptr));
- binary_protocol_global_remset (ptr, *(gpointer*)ptr, (gpointer)LOAD_VTABLE (obj));
+ binary_protocol_global_remset (ptr, *(gpointer*)ptr, (gpointer)SGEN_LOAD_VTABLE (obj));
HEAVY_STAT (++stat_global_remsets_added);

0 comments on commit ee0bc0d

Please sign in to comment.
Something went wrong with that request. Please try again.