Removed DeflateStream.UnmanagedRead Read loop. Fixes #19313.
[mono.git] / mono / metadata / sgen-simple-nursery.c
1 /*
2  * sgen-simple-nursery.c: Simple always promote nursery.
3  *
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
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License 2.0 as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License 2.0 along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 #include "config.h"
24 #ifdef HAVE_SGEN_GC
25
26 #include "metadata/profiler-private.h"
27
28 #include "metadata/sgen-gc.h"
29 #include "metadata/sgen-protocol.h"
30 #include "metadata/sgen-layout-stats.h"
31
32 static inline char*
33 alloc_for_promotion (MonoVTable *vtable, char *obj, size_t objsize, gboolean has_references)
34 {
35         return major_collector.alloc_object (vtable, objsize, has_references);
36 }
37
38 static inline char*
39 par_alloc_for_promotion (MonoVTable *vtable, char *obj, size_t objsize, gboolean has_references)
40 {
41         return major_collector.par_alloc_object (vtable, objsize, has_references);
42 }
43
44 static SgenFragment*
45 build_fragments_get_exclude_head (void)
46 {
47         return NULL;
48 }
49
50 static void
51 build_fragments_release_exclude_head (void)
52 {
53 }
54
55 static void
56 build_fragments_finish (SgenFragmentAllocator *allocator)
57 {
58 }
59
60 static void
61 prepare_to_space (char *to_space_bitmap, int space_bitmap_size)
62 {
63 }
64
65 static void
66 clear_fragments (void)
67 {       
68 }
69
70 static void
71 init_nursery (SgenFragmentAllocator *allocator, char *start, char *end)
72 {
73         sgen_fragment_allocator_add (allocator, start, end);
74 }
75
76
77 /******************************************Copy/Scan functins ************************************************/
78
79 #define SGEN_SIMPLE_NURSERY
80
81 #define SERIAL_COPY_OBJECT simple_nursery_serial_copy_object
82 #define PARALLEL_COPY_OBJECT simple_nursery_parallel_copy_object
83 #define SERIAL_COPY_OBJECT_FROM_OBJ simple_nursery_serial_copy_object_from_obj
84
85 #include "sgen-minor-copy-object.h"
86 #include "sgen-minor-scan-object.h"
87
88 void
89 sgen_simple_nursery_init (SgenMinorCollector *collector)
90 {
91         collector->is_split = FALSE;
92
93         collector->alloc_for_promotion = alloc_for_promotion;
94         collector->par_alloc_for_promotion = par_alloc_for_promotion;
95
96         collector->prepare_to_space = prepare_to_space;
97         collector->clear_fragments = clear_fragments;
98         collector->build_fragments_get_exclude_head = build_fragments_get_exclude_head;
99         collector->build_fragments_release_exclude_head = build_fragments_release_exclude_head;
100         collector->build_fragments_finish = build_fragments_finish;
101         collector->init_nursery = init_nursery;
102
103         FILL_MINOR_COLLECTOR_COPY_OBJECT (collector);
104         FILL_MINOR_COLLECTOR_SCAN_OBJECT (collector);
105 }
106
107
108 #endif