memory copy (Re: RACE CONDITION!!!!!)

Yoshiki Ohshima Yoshiki.Ohshima at acm.org
Thu Apr 1 19:56:27 UTC 2004


  Alan,

>   It could be that your memcpy equivalent is wrong?  For example, if
> the compaction phase, or any phase, of the garbage collection, is not
> doing correct thing, or object creation doesn't do nil-out, etc.,
> etc. can cause this kind of errors.

  Oh, by the way, speaking of memcpy equivalent, I've been advocating
(well, just sent two related emails over 2-3 years period) that we
should look at what the #copy (and deepCopy and veryDeepCopy) message
does to some important collection objects like strings.

  For example, if you send #copy to a String, it first allocates the
space for the new object, zero-out the space and copy over the
original string onto it.  But if we use #clone to implement #copy, we
can eliminate the zero-out or nil-out phase and speed it up by 30% or
so on a platform I tested.  Strings and Symbols are heavily used in
the structure of a morph, and copy a morph involves a lot of copying
of those.

-- Yoshiki



More information about the Squeak-dev mailing list