On Tue, 23 Nov 2010 23:43:34 -0500, dsimcha <[email protected]> wrote:

I was browsing through druntime's lifetime.d for an unrelated reason and I noticed that, when an array is copied for the purpose of appending to it, the postblits are not called on the new array if it is an array of structs. Is there something I'm missing, or is this a bug that somehow noone has noticed
up to this point?

Array appending does not respect any of the new copy construction semantics. It basically does a memcpy and that's it. It doesn't even respect shared (shared data is memcpy'd just like any other data), although it does use a lock to protect shared appends.

I see there is a postblit function in the typeinfo, so it should be possible to do the right thing.

One thing I'm unsure of is how postblit works on const or immutable structs, anyone know? There is no typechecking in the array functions, everything is a void[].

File a bug on it please.

-Steve

Reply via email to