I'm not an NTB expert, but LGTM.
|1306 ↗||(On Diff #77900)|
It would catch a scribbler earlier.
|1146 ↗||(On Diff #78164)|
desired_vectors was just assigned to num_vectors, so this is always true.
|1155 ↗||(On Diff #78164)|
|1840 ↗||(On Diff #78164)|
|2147–2148 ↗||(On Diff #78164)|
I assume this is a rare case, but adding the sizes to the error message could be helpful.
|3253–3256 ↗||(On Diff #78164)|
You could remove the condition and keep only limit = base + size;. Or maybe a different condition is needed?