2 * sgen-simple-nursery.c: Simple always promote nursery.
4 * Copyright 2001-2003 Ximian, Inc
5 * Copyright 2003-2010 Novell, Inc.
6 * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
7 * Copyright (C) 2012 Xamarin Inc
9 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
17 #include "mono/sgen/sgen-gc.h"
18 #include "mono/sgen/sgen-protocol.h"
19 #include "mono/sgen/sgen-layout-stats.h"
20 #include "mono/sgen/sgen-client.h"
21 #include "mono/utils/mono-memory-model.h"
23 static inline GCObject*
24 alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean has_references)
26 total_promoted_size += objsize;
27 return major_collector.alloc_object (vtable, objsize, has_references);
31 build_fragments_get_exclude_head (void)
37 build_fragments_release_exclude_head (void)
42 build_fragments_finish (SgenFragmentAllocator *allocator)
47 prepare_to_space (char *to_space_bitmap, size_t space_bitmap_size)
52 clear_fragments (void)
57 init_nursery (SgenFragmentAllocator *allocator, char *start, char *end)
59 sgen_fragment_allocator_add (allocator, start, end);
63 /******************************************Copy/Scan functins ************************************************/
65 #define SGEN_SIMPLE_NURSERY
67 #define SERIAL_COPY_OBJECT simple_nursery_serial_copy_object
68 #define SERIAL_COPY_OBJECT_FROM_OBJ simple_nursery_serial_copy_object_from_obj
70 #include "sgen-minor-copy-object.h"
71 #include "sgen-minor-scan-object.h"
74 sgen_simple_nursery_init (SgenMinorCollector *collector)
76 collector->is_split = FALSE;
78 collector->alloc_for_promotion = alloc_for_promotion;
80 collector->prepare_to_space = prepare_to_space;
81 collector->clear_fragments = clear_fragments;
82 collector->build_fragments_get_exclude_head = build_fragments_get_exclude_head;
83 collector->build_fragments_release_exclude_head = build_fragments_release_exclude_head;
84 collector->build_fragments_finish = build_fragments_finish;
85 collector->init_nursery = init_nursery;
87 FILL_MINOR_COLLECTOR_COPY_OBJECT (collector);
88 FILL_MINOR_COLLECTOR_SCAN_OBJECT (collector);