2009/3/25 Neil Jerram <n...@ossau.uklinux.net>:

> #2 makes the symbols hash thread-safe, and it appears that this
> completely fixes the define-race problem.

I reviewed patch2 as best I could, but I'm cross-eyed
cause its late at night, and I don't know guile internals
well.  So I'm not sure my review means much.  However,
isn't the following a mem leak:

+static SCM
+intern_symbol (SCM symbol, const char *name, size_t len, size_t raw_hash)

+  /* Allocate new cell and bucket before locking the mutex. */
+  new_bucket = scm_acons (symbol, SCM_UNDEFINED, SCM_BOOL_F);

+  for (l = slot; !scm_is_null (l); l = SCM_CDR (l))

...
+
+         scm_i_pthread_mutex_unlock (&symbols_mutex);
+         return sym;

it looks to me like new_bucket is never released.
I assume that the scm_acons did a malloc, but
maybe not

I'm to tired to say anything meaningful about the rest ...

--linas

p.s. many thanks for chasing this stuff down and fixing it !
It is all a very pleasant surprise!


Reply via email to