clover: Reserve vector memory in make_text_section
This isn't strictly required, but it works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366 , and it might avoid a memory reallocation. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
This commit is contained in:
@@ -125,6 +125,7 @@ namespace {
|
||||
const pipe_binary_program_header header { uint32_t(code.size()) };
|
||||
binary::section text { 0, section_type, header.num_bytes, {} };
|
||||
|
||||
text.data.reserve(sizeof(header) + header.num_bytes);
|
||||
text.data.insert(text.data.end(), reinterpret_cast<const char *>(&header),
|
||||
reinterpret_cast<const char *>(&header) + sizeof(header));
|
||||
text.data.insert(text.data.end(), code.begin(), code.end());
|
||||
|
||||
Reference in New Issue
Block a user