This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using SCMs as hash keys


Andrew Chadwick <andrew.chadwick@symbian.com> writes:

> I know that a SCM is a long with type bits, and I'll be doing a
> scm_protect_object on each key as it gets added. g_int_hash() and
> g_int_equal() seem to do the right thing on my system. Are there any
> issues involved with pulling out these SCMs and exporting them back to
> the Guile environment in a list?

Don't use scm_protect_object on a large number of objects; it's slow.
Protect a single hash table and put the objects in there.

-russ


--
There is always free cheese in a mousetrap.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]