diff options
author | Ludovic Courtes <ludovic.courtes@laas.fr> | 2006-11-27 00:16:27 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-10 22:19:30 +0200 |
commit | 8e7b3e98072ef30557a0396367ae8b42170e5507 (patch) | |
tree | 9cf37418cb872daca165a6b250b44565b6d18e08 | |
parent | fdab75a144580898b4917e01191df1f1875c5a1f (diff) | |
download | guile-8e7b3e98072ef30557a0396367ae8b42170e5507.tar.gz |
Removed `scm_gc_registered_roots' and `scm_permobjs'.
* libguile/gc.c (scm_permanent_object): Use `scm_gc_protect_object ()'.
(scm_gc_register_root): Do nothing.
(scm_init_storage): Removed initialization of `scm_permobjs' and
`scm_gc_register_roots'.
* libguile/root.h (scm_permobjs): Removed.
(scm_gc_registered_roots): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-50
-rw-r--r-- | libguile/gc.c | 48 | ||||
-rw-r--r-- | libguile/root.h | 12 |
2 files changed, 8 insertions, 52 deletions
diff --git a/libguile/gc.c b/libguile/gc.c index cfdc36055..142fd0be9 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -501,12 +501,7 @@ scm_return_first_int (int i, ...) SCM scm_permanent_object (SCM obj) { - SCM cell = scm_cons (obj, SCM_EOL); - SCM_CRITICAL_SECTION_START; - SCM_SETCDR (cell, scm_permobjs); - scm_permobjs = cell; - SCM_CRITICAL_SECTION_END; - return obj; + return (scm_gc_protect_object (obj)); } @@ -591,48 +586,13 @@ scm_gc_unprotect_object (SCM obj) void scm_gc_register_root (SCM *p) { - SCM handle; - SCM key = scm_from_ulong ((unsigned long) p); - - /* This critical section barrier will be replaced by a mutex. */ - /* njrev: and again. */ - SCM_CRITICAL_SECTION_START; - - handle = scm_hashv_create_handle_x (scm_gc_registered_roots, key, - scm_from_int (0)); - /* njrev: note also that the above can probably signal an error */ - SCM_SETCDR (handle, scm_sum (SCM_CDR (handle), scm_from_int (1))); - - SCM_CRITICAL_SECTION_END; + /* Nothing. */ } void scm_gc_unregister_root (SCM *p) { - SCM handle; - SCM key = scm_from_ulong ((unsigned long) p); - - /* This critical section barrier will be replaced by a mutex. */ - /* njrev: and again. */ - SCM_CRITICAL_SECTION_START; - - handle = scm_hashv_get_handle (scm_gc_registered_roots, key); - - if (scm_is_false (handle)) - { - fprintf (stderr, "scm_gc_unregister_root called on unregistered root\n"); - abort (); - } - else - { - SCM count = scm_difference (SCM_CDR (handle), scm_from_int (1)); - if (scm_is_eq (count, scm_from_int (0))) - scm_hashv_remove_x (scm_gc_registered_roots, key); - else - SCM_SETCDR (handle, count); - } - - SCM_CRITICAL_SECTION_END; + /* Nothing. */ } void @@ -729,9 +689,7 @@ scm_init_storage () #endif scm_stand_in_procs = scm_make_weak_key_hash_table (scm_from_int (257)); - scm_permobjs = SCM_EOL; scm_protects = scm_c_make_hash_table (31); - scm_gc_registered_roots = scm_c_make_hash_table (31); return 0; } diff --git a/libguile/root.h b/libguile/root.h index 6c7800f5f..21cd8a380 100644 --- a/libguile/root.h +++ b/libguile/root.h @@ -35,13 +35,11 @@ #define scm_keyword_obarray scm_sys_protects[4] #define scm_stand_in_procs scm_sys_protects[5] #define scm_object_whash scm_sys_protects[6] -#define scm_permobjs scm_sys_protects[7] -#define scm_asyncs scm_sys_protects[8] -#define scm_protects scm_sys_protects[9] -#define scm_properties_whash scm_sys_protects[10] -#define scm_gc_registered_roots scm_sys_protects[11] -#define scm_source_whash scm_sys_protects[12] -#define SCM_NUM_PROTECTS 13 +#define scm_asyncs scm_sys_protects[7] +#define scm_protects scm_sys_protects[8] +#define scm_properties_whash scm_sys_protects[9] +#define scm_source_whash scm_sys_protects[10] +#define SCM_NUM_PROTECTS 11 SCM_API SCM scm_sys_protects[]; |