summaryrefslogtreecommitdiff
path: root/blacklst.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-03-20 11:31:14 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:56 +0200
commitad269687a9cb0d834eed41ad67c9c4acbad205c9 (patch)
treea0260f0f9cbd1b1e2b887acfc42ec4686c3ae644 /blacklst.c
parentc2dddb53a10205f986ae782e5b1e7105f0ea80c5 (diff)
2011-03-20 Ivan Maidanski <ivmai@mail.ru>
* blacklst.c (GC_bl_init_no_interiors): New function (the code moved from GC_bl_init). * blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless GC_all_interior_pointers mode; remove unnecessarily parameter cast for GC_scratch_alloc call. * include/private/gc_priv.h (GC_bl_init): Move the function declaration to misc.c file. * misc.c (GC_bl_init_no_interiors): Add a prototype. * misc.c (GC_set_all_interior_pointers): Allow values other than 0 and 1; allow altering GC_set_all_interior_pointers value even after GC initialization. * obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and GC_modws_valid_offsets if GC_all_interior_pointers is off. * misc.c (GC_init): Don't call GC_initialize_offsets() unless GC_all_interior_pointers mode.
Diffstat (limited to 'blacklst.c')
-rw-r--r--blacklst.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/blacklst.c b/blacklst.c
index 1fb9d00..a6df693 100644
--- a/blacklst.c
+++ b/blacklst.c
@@ -83,23 +83,28 @@ STATIC void GC_print_source_ptr(ptr_t p)
}
#endif
+GC_INNER void GC_bl_init_no_interiors(void)
+{
+ if (GC_incomplete_normal_bl == 0) {
+ GC_old_normal_bl = (word *)GC_scratch_alloc(sizeof(page_hash_table));
+ GC_incomplete_normal_bl = (word *)GC_scratch_alloc(
+ sizeof(page_hash_table));
+ if (GC_old_normal_bl == 0 || GC_incomplete_normal_bl == 0) {
+ GC_err_printf("Insufficient memory for black list\n");
+ EXIT();
+ }
+ GC_clear_bl(GC_old_normal_bl);
+ GC_clear_bl(GC_incomplete_normal_bl);
+ }
+}
+
GC_INNER void GC_bl_init(void)
{
if (!GC_all_interior_pointers) {
- GC_old_normal_bl = (word *)
- GC_scratch_alloc((word)(sizeof (page_hash_table)));
- GC_incomplete_normal_bl = (word *)GC_scratch_alloc
- ((word)(sizeof(page_hash_table)));
- if (GC_old_normal_bl == 0 || GC_incomplete_normal_bl == 0) {
- GC_err_printf("Insufficient memory for black list\n");
- EXIT();
- }
- GC_clear_bl(GC_old_normal_bl);
- GC_clear_bl(GC_incomplete_normal_bl);
+ GC_bl_init_no_interiors();
}
- GC_old_stack_bl = (word *)GC_scratch_alloc((word)(sizeof(page_hash_table)));
- GC_incomplete_stack_bl = (word *)GC_scratch_alloc
- ((word)(sizeof(page_hash_table)));
+ GC_old_stack_bl = (word *)GC_scratch_alloc(sizeof(page_hash_table));
+ GC_incomplete_stack_bl = (word *)GC_scratch_alloc(sizeof(page_hash_table));
if (GC_old_stack_bl == 0 || GC_incomplete_stack_bl == 0) {
GC_err_printf("Insufficient memory for black list\n");
EXIT();