From: Carsten N. <car...@gm...> - 2007-04-06 12:05:37
|
Hi Gerrit, I've looked at the MField sync and have a couple of questions (I know you are still working on parts of this, so some questions might not be relevant): - I think AspectOffsetStore should be std::vector<ptrdiff_t> otherwise I'd (maybe naively) expect problems on 64 bit archs ? - AspectStore::fillOffsetArray invokes undefined behavior, I think, by performing pointer arithmetic on pointers that do not point into the same array (I've tried to read the relevant parts of the standard, but the language it uses is a bit difficult ;) ). I'm aware this is not likely to be a problem, but I wonder how long it will take until some clever compiler uses this to optimize the loop in that function away and returns a vector full of -1 entries ? - fillOffsetArray is called quite often it seems, wouldn't it make sense to pass the AspectStore to the relevant functions instead and cache the offsets there, for example ? Or we could cache the offsets of the fields from the start of the container. This would never change (except for DynamicFieldAttachment) even if container copies/instances in some aspects a destroyed and recreated. Thanks, Carsten |