First set of licensing changes
[mono.git] / mono / metadata / boehm-gc.c
index d26a8c2e9aab5952c3f480906ecbfdea7f5a412b..43844ad98304cfed42194dc622df44a161fe27ab 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2011 Novell, Inc (http://www.novell.com)
  * Copyright 2011-2012 Xamarin, Inc (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include "config.h"
@@ -1068,7 +1069,7 @@ create_allocator (int atype, int tls_key, gboolean slowpath)
  always_slowpath:
        if (atype == ATYPE_STRING) {
                mono_mb_emit_ldarg (mb, 1);
-               mono_mb_emit_icall (mb, mono_string_alloc);
+               mono_mb_emit_icall (mb, ves_icall_string_alloc);
        } else {
                mono_mb_emit_ldarg (mb, 0);
                mono_mb_emit_icall (mb, ves_icall_object_new_specific);
@@ -1079,10 +1080,10 @@ create_allocator (int atype, int tls_key, gboolean slowpath)
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
        info->d.alloc.gc_name = "boehm";
        info->d.alloc.alloc_type = atype;
+       mb->init_locals = FALSE;
 
        res = mono_mb_create (mb, csig, 8, info);
        mono_mb_free (mb);
-       mono_method_get_header (res)->init_locals = FALSE;
 
        return res;
 }
@@ -1696,7 +1697,7 @@ mono_gchandle_new (MonoObject *obj, gboolean pinned)
 /**
  * mono_gchandle_new_weakref:
  * @obj: managed object to get a handle for
- * @pinned: whether the object should be pinned
+ * @track_resurrection: Determines how long to track the object, if this is set to TRUE, the object is tracked after finalization, if FALSE, the object is only tracked up until the point of finalization.
  *
  * This returns a weak handle that wraps the object, this is used to
  * keep a reference to a managed object from the unmanaged world.
@@ -1704,10 +1705,12 @@ mono_gchandle_new (MonoObject *obj, gboolean pinned)
  * garbage collector.  In this case the value of the GCHandle will be
  * set to zero.
  * 
- * If @pinned is false the address of the object can not be obtained, if it is
- * true the address of the object can be obtained.  This will also pin the
- * object so it will not be possible by a moving garbage collector to move the
- * object. 
+ * If @track_resurrection is TRUE the object will be tracked through
+ * finalization and if the object is resurrected during the execution
+ * of the finalizer, then the returned weakref will continue to hold
+ * a reference to the object.   If @track_resurrection is FALSE, then
+ * the weak reference's target will become NULL as soon as the object
+ * is passed on to the finalizer.
  * 
  * Returns: a handle that can be used to access the object from
  * unmanaged code.
@@ -1722,10 +1725,10 @@ mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection)
  * mono_gchandle_get_target:
  * @gchandle: a GCHandle's handle.
  *
- * The handle was previously created by calling mono_gchandle_new or
- * mono_gchandle_new_weakref. 
+ * The handle was previously created by calling `mono_gchandle_new` or
+ * `mono_gchandle_new_weakref`.
  *
- * Returns a pointer to the MonoObject represented by the handle or
+ * Returns: A pointer to the `MonoObject*` represented by the handle or
  * NULL for a collected object if using a weakref handle.
  */
 MonoObject*
@@ -1782,19 +1785,22 @@ mono_gchandle_set_target (guint32 gchandle, MonoObject *obj)
        unlock_handles (handles);
 }
 
-/**
- * mono_gchandle_is_in_domain:
- * @gchandle: a GCHandle's handle.
- * @domain: An application domain.
- *
- * Returns: true if the object wrapped by the @gchandle belongs to the specific @domain.
- */
 gboolean
 mono_gc_is_null (void)
 {
        return FALSE;
 }
 
+/**
+ * mono_gchandle_is_in_domain:
+ * @gchandle: a GCHandle's handle.
+ * @domain: An application domain.
+ *
+ * Use this function to determine if the @gchandle points to an
+ * object allocated in the specified @domain.
+ *
+ * Returns: TRUE if the object wrapped by the @gchandle belongs to the specific @domain.
+ */
 gboolean
 mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain)
 {