This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: Something like vector-grow available?
- To: Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE>
- Subject: Re: Something like vector-grow available?
- From: Jim Blandy <jimb@red-bean.com>
- Date: 25 Jul 1999 21:58:28 -0500
- Cc: guile@sourceware.cygnus.com
- References: <199907241531.PAA03668@linux.zrz.TU-Berlin.DE>
> is there an easy way to grow a vector dynamically? At the moment I
> allocate a new one and copy all elements to this new vector.
>
> Is there a more elegant solution?
I'm not sure how I feel about vector-grow. It seems to me that, in a
multi-threaded system, if the address of the vector's elements can
change, then you have to acquire a lock for every access to a vector
element, if you want to preserve the obvious semantics. Maybe someone
else has better ideas on how to implement this.