Moving a string buffer from the heap to the stack