mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 04:30:19 +02:00
(scm_init_storage, scm_stand_in_procs, scm_stand_in_proc): Use a
hastable for scm_stand_in_procs instead of an alist. Thanks to Matthias Koeppe!
This commit is contained in:
parent
35da08ee37
commit
82c76fd357
2 changed files with 8 additions and 7 deletions
|
@ -917,7 +917,7 @@ scm_init_storage ()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
scm_stand_in_procs = SCM_EOL;
|
scm_stand_in_procs = scm_c_make_hash_table (257);
|
||||||
scm_permobjs = SCM_EOL;
|
scm_permobjs = SCM_EOL;
|
||||||
scm_protects = scm_c_make_hash_table (31);
|
scm_protects = scm_c_make_hash_table (31);
|
||||||
scm_gc_registered_roots = scm_c_make_hash_table (31);
|
scm_gc_registered_roots = scm_c_make_hash_table (31);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1995,1996,1998,2000,2001, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 1995,1996,1998,2000,2001,2003,2004 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include "libguile/smob.h"
|
#include "libguile/smob.h"
|
||||||
#include "libguile/root.h"
|
#include "libguile/root.h"
|
||||||
#include "libguile/vectors.h"
|
#include "libguile/vectors.h"
|
||||||
|
#include "libguile/hashtab.h"
|
||||||
|
|
||||||
#include "libguile/validate.h"
|
#include "libguile/validate.h"
|
||||||
#include "libguile/procprop.h"
|
#include "libguile/procprop.h"
|
||||||
|
@ -136,15 +137,15 @@ scm_i_procedure_arity (SCM proc)
|
||||||
static SCM
|
static SCM
|
||||||
scm_stand_in_scm_proc(SCM proc)
|
scm_stand_in_scm_proc(SCM proc)
|
||||||
{
|
{
|
||||||
SCM answer;
|
SCM handle, answer;
|
||||||
answer = scm_assq (proc, scm_stand_in_procs);
|
handle = scm_hashq_get_handle (scm_stand_in_procs, proc);
|
||||||
if (scm_is_false (answer))
|
if (scm_is_false (handle))
|
||||||
{
|
{
|
||||||
answer = scm_closure (scm_list_2 (SCM_EOL, SCM_BOOL_F), SCM_EOL);
|
answer = scm_closure (scm_list_2 (SCM_EOL, SCM_BOOL_F), SCM_EOL);
|
||||||
scm_stand_in_procs = scm_acons (proc, answer, scm_stand_in_procs);
|
scm_hashq_set_x (scm_stand_in_procs, proc, answer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
answer = SCM_CDR (answer);
|
answer = SCM_CDR (handle);
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue