MonoArray *arr;
MonoArrayBounds *bounds;
+#ifndef DISABLE_CRITICAL_REGION
+ TLAB_ACCESS_INIT;
+ ENTER_CRITICAL_REGION;
+ arr = mono_gc_try_alloc_obj_nolock (vtable, size);
+ if (arr) {
+ /*This doesn't require fencing since EXIT_CRITICAL_REGION already does it for us*/
+ arr->max_length = max_length;
+
+ bounds = (MonoArrayBounds*)((char*)arr + size - bounds_size);
+ arr->bounds = bounds;
+ EXIT_CRITICAL_REGION;
+ return arr;
+ }
+ EXIT_CRITICAL_REGION;
+#endif
+
LOCK_GC;
arr = mono_gc_alloc_obj_nolock (vtable, size);