Skip to content

Commit

Permalink
Fix compiling with SGEN_BINARY_PROTOCOL.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Oct 14, 2012
1 parent f6a5608 commit ee0bc0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mono/metadata/sgen-gc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ major_do_collection (const char *reason)
GCRootReport report; GCRootReport report;
report.count = 0; report.count = 0;
if (sgen_find_optimized_pin_queue_area (bigobj->data, (char*)bigobj->data + bigobj->size, &dummy)) { 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 ())) { if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
MonoVTable *vt = (MonoVTable*)LOAD_VTABLE (bigobj->data); 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); MONO_GC_OBJ_PINNED ((mword)bigobj->data, sgen_safe_object_get_size ((MonoObject*)bigobj->data), vt->klass->name_space, vt->klass->name, GENERATION_OLD);
Expand Down Expand Up @@ -4193,6 +4193,7 @@ mono_gc_wbarrier_value_copy (gpointer dest, gpointer src, int count, MonoClass *


#ifdef SGEN_BINARY_PROTOCOL #ifdef SGEN_BINARY_PROTOCOL
{ {
size_t element_size = mono_class_value_size (klass, NULL);
int i; int i;
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
scan_object_for_binary_protocol_copy_wbarrier ((char*)dest + i * element_size, scan_object_for_binary_protocol_copy_wbarrier ((char*)dest + i * element_size,
Expand Down
7 changes: 7 additions & 0 deletions mono/metadata/sgen-protocol.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */


#ifdef HAVE_SGEN_GC

#include "config.h" #include "config.h"
#include "sgen-gc.h"
#include "sgen-protocol.h" #include "sgen-protocol.h"
#include "sgen-memory-governor.h"
#include "utils/mono-mmap.h"


#ifdef SGEN_BINARY_PROTOCOL #ifdef SGEN_BINARY_PROTOCOL


Expand Down Expand Up @@ -265,3 +270,5 @@ binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offset, g
} }


#endif #endif

#endif /* HAVE_SGEN_GC */
4 changes: 2 additions & 2 deletions mono/metadata/sgen-ssb.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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); 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)); DEBUG (9, fprintf (gc_debug_file, "Overwrote remset at %p with %p\n", ptr, *ptr));
if (old) 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 (!global && *ptr >= start_nursery && *ptr < end_nursery) {
/* /*
* If the object is pinned, each reference to it from nonpinned objects * If the object is pinned, each reference to it from nonpinned objects
Expand Down Expand Up @@ -752,7 +752,7 @@ sgen_ssb_record_pointer (gpointer ptr)
sgen_pin_stats_register_global_remset (obj); sgen_pin_stats_register_global_remset (obj);


DEBUG (8, fprintf (gc_debug_file, "Adding global remset for %p\n", ptr)); 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); HEAVY_STAT (++stat_global_remsets_added);


Expand Down

0 comments on commit ee0bc0d

Please sign in to comment.