Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[sgen] Fix small bitmap descriptor bug with large objects.

Objects larger than 64k whose references still fit within a small bitmap
would overflow the size bit field within the descriptor.
  • Loading branch information...
commit 62c93fdae33630b9003f144e279fc419fb26e6bb 1 parent 84ec6ef
Mark Probst schani authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  mono/metadata/sgen-descriptor.c
2  mono/metadata/sgen-descriptor.c
@@ -161,7 +161,7 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size)
161 161 }
162 162
163 163 /* we know the 2-word header is ptr-free */
164   - if (last_set < SMALL_BITMAP_SIZE + OBJECT_HEADER_WORDS) {
  164 + if (last_set < SMALL_BITMAP_SIZE + OBJECT_HEADER_WORDS && stored_size < (1 << SMALL_BITMAP_SHIFT)) {
165 165 desc = DESC_TYPE_SMALL_BITMAP | stored_size | ((*bitmap >> OBJECT_HEADER_WORDS) << SMALL_BITMAP_SHIFT);
166 166 SGEN_LOG (6, "Smallbitmap descriptor %p, size: %zd, last set: %d", (void*)desc, stored_size, last_set);
167 167 return (void*) desc;

0 comments on commit 62c93fd

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