Hi!
In current implementation message_queue checks supplied buffer size against maximum possible message size, not against the current message size.
Moving check to place, where size of next object is already known would allow user to increase the allocated size only when needed. This would help limit memory allocation in case of queue sending messages of very different sizes.