add detach_buffer.cpp (not yet finished).