Merge pull request #550 from knocte/master
[mono.git] / mono / metadata / sgen-simple-nursery.c
index 3f07688e1461da9ea11734a50bd8bbf046b12a2b..0e9a02ccd8e544d0784efcb8666ab7a3e29bd726 100644 (file)
@@ -1,31 +1,23 @@
 /*
  * sgen-simple-nursery.c: Simple always promote nursery.
  *
- *
- * SGen is licensed under the terms of the MIT X11 license
- *
  * Copyright 2001-2003 Ximian, Inc
  * Copyright 2003-2010 Novell, Inc.
  * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
- * 
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Copyright (C) 2012 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include "config.h"
 #include "metadata/sgen-protocol.h"
 
 static inline char*
-alloc_for_promotion (char *obj, size_t objsize, gboolean has_references)
+alloc_for_promotion (MonoVTable *vtable, char *obj, size_t objsize, gboolean has_references)
 {
-       return major_collector.alloc_object (objsize, has_references);
+       return major_collector.alloc_object (vtable, objsize, has_references);
 }
 
 static inline char*
-par_alloc_for_promotion (char *obj, size_t objsize, gboolean has_references)
+par_alloc_for_promotion (MonoVTable *vtable, char *obj, size_t objsize, gboolean has_references)
 {
-       return major_collector.par_alloc_object (objsize, has_references);
+       return major_collector.par_alloc_object (vtable, objsize, has_references);
 }
 
 static SgenFragment*
@@ -83,12 +75,20 @@ init_nursery (SgenFragmentAllocator *allocator, char *start, char *end)
 
 /******************************************Copy/Scan functins ************************************************/
 
+#define SGEN_SIMPLE_NURSERY
+
+#define SERIAL_COPY_OBJECT simple_nursery_serial_copy_object
+#define PARALLEL_COPY_OBJECT simple_nursery_parallel_copy_object
+#define SERIAL_COPY_OBJECT_FROM_OBJ simple_nursery_serial_copy_object_from_obj
+
 #include "sgen-minor-copy-object.h"
 #include "sgen-minor-scan-object.h"
 
 void
 sgen_simple_nursery_init (SgenMinorCollector *collector)
 {
+       collector->is_split = FALSE;
+
        collector->alloc_for_promotion = alloc_for_promotion;
        collector->par_alloc_for_promotion = par_alloc_for_promotion;
 
@@ -104,4 +104,4 @@ sgen_simple_nursery_init (SgenMinorCollector *collector)
 }
 
 
-#endif
\ No newline at end of file
+#endif