realtime: avoid redundant copying in time-critical sections