Writing to a malloc buffer and then copying is faster on a variety of Pixel devices. Since this change was supposed to be a performance optimization, just back it out.