rework Sharedmemory_update() to not use memcpy (requested by fatbob)