use buffer_t consistently everywhere