mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
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:
parent
53ce756eeb
commit
2a626f999a
1 changed files with 1 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue