RAII utils for buffers, etc.