2 * sgen-simple-nursery.c: Simple always promote nursery.
5 * SGen is licensed under the terms of the MIT X11 license
7 * Copyright 2001-2003 Ximian, Inc
8 * Copyright 2003-2010 Novell, Inc.
9 * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
11 * Permission is hereby granted, free of charge, to any person obtaining
12 * a copy of this software and associated documentation files (the
13 * "Software"), to deal in the Software without restriction, including
14 * without limitation the rights to use, copy, modify, merge, publish,
15 * distribute, sublicense, and/or sell copies of the Software, and to
16 * permit persons to whom the Software is furnished to do so, subject to
17 * the following conditions:
19 * The above copyright notice and this permission notice shall be
20 * included in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 #include "metadata/profiler-private.h"
36 #include "metadata/sgen-gc.h"
37 #include "metadata/sgen-protocol.h"
40 alloc_for_promotion (char *obj, size_t objsize, gboolean has_references)
42 return major_collector.alloc_object (objsize, has_references);
46 par_alloc_for_promotion (char *obj, size_t objsize, gboolean has_references)
48 return major_collector.par_alloc_object (objsize, has_references);
52 build_fragments_get_exclude_head (void)
58 build_fragments_release_exclude_head (void)
63 build_fragments_finish (SgenFragmentAllocator *allocator)
68 prepare_to_space (char *to_space_bitmap, int space_bitmap_size)
73 clear_fragments (void)
78 init_nursery (SgenFragmentAllocator *allocator, char *start, char *end)
80 sgen_fragment_allocator_add (allocator, start, end);
84 /******************************************Copy/Scan functins ************************************************/
86 #include "sgen-minor-copy-object.h"
87 #include "sgen-minor-scan-object.h"
90 sgen_simple_nursery_init (SgenMinorCollector *collector)
92 collector->alloc_for_promotion = alloc_for_promotion;
93 collector->par_alloc_for_promotion = par_alloc_for_promotion;
95 collector->prepare_to_space = prepare_to_space;
96 collector->clear_fragments = clear_fragments;
97 collector->build_fragments_get_exclude_head = build_fragments_get_exclude_head;
98 collector->build_fragments_release_exclude_head = build_fragments_release_exclude_head;
99 collector->build_fragments_finish = build_fragments_finish;
100 collector->init_nursery = init_nursery;
102 FILL_MINOR_COLLECTOR_COPY_OBJECT (collector);
103 FILL_MINOR_COLLECTOR_SCAN_OBJECT (collector);