shift offsetof functions out of generator