Skip to content

Commit a14a990

Browse files
committed
cleanup and oob error fix
1 parent 4a8407b commit a14a990

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

mono/metadata/unity-liveness.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
typedef struct _LivenessState LivenessState;
1212

1313
#define k_block_size (8 * 1024)
14-
#define k_array_elements_per_block ((k_block_size - 2 * sizeof (guint) - sizeof (gpointer)) / sizeof (gpointer))
14+
#define k_array_elements_per_block ((k_block_size - 3 * sizeof (void*)) / sizeof (gpointer))
1515

1616
typedef struct _custom_array_block custom_array_block;
1717

@@ -146,27 +146,6 @@ void block_array_destroy(custom_growable_block_array *block_array, LivenessState
146146
g_free(block_array);
147147
}
148148

149-
#if defined(HAVE_SGEN_GC)
150-
void sgen_stop_world(int generation);
151-
void sgen_restart_world(int generation);
152-
#elif defined(HAVE_BOEHM_GC)
153-
#ifdef HAVE_BDWGC_GC
154-
extern void GC_stop_world_external();
155-
extern void GC_start_world_external();
156-
#else
157-
void GC_stop_world_external()
158-
{
159-
g_assert_not_reached();
160-
}
161-
void GC_start_world_external()
162-
{
163-
g_assert_not_reached();
164-
}
165-
#endif
166-
#else
167-
#error need to implement liveness GC API
168-
#endif
169-
170149
/* number of sub elements of an array to process before recursing
171150
* we take a depth first approach to use stack space rather than re-allocating
172151
* processing array which requires restarting world to ensure allocator lock is not held
@@ -556,25 +535,3 @@ void mono_unity_liveness_free_struct(LivenessState *state)
556535
block_array_destroy(state->process_array, state);
557536
g_free(state);
558537
}
559-
560-
void mono_unity_liveness_stop_gc_world()
561-
{
562-
#if defined(HAVE_SGEN_GC)
563-
sgen_stop_world(1);
564-
#elif defined(HAVE_BOEHM_GC)
565-
GC_stop_world_external();
566-
#else
567-
#error need to implement liveness GC API
568-
#endif
569-
}
570-
571-
void mono_unity_liveness_start_gc_world()
572-
{
573-
#if defined(HAVE_SGEN_GC)
574-
sgen_restart_world(1);
575-
#elif defined(HAVE_BOEHM_GC)
576-
GC_start_world_external();
577-
#else
578-
#error need to implement liveness GC API
579-
#endif
580-
}

0 commit comments

Comments
 (0)