Commit c76f1310 by Ben Clayton

Squashed 'third_party/marl/' changes from 94a361cf0..64d123947

64d123947 thread.cpp: Replace use of alloca with vector. git-subtree-dir: third_party/marl git-subtree-split: 64d123947e4dbc741217ea7b49f3d2b6275be117
parent 3e2f8421
...@@ -124,8 +124,9 @@ Thread::Thread(unsigned int logicalCpu, const Func& func) { ...@@ -124,8 +124,9 @@ Thread::Thread(unsigned int logicalCpu, const Func& func) {
MARL_ASSERT(size > 0, MARL_ASSERT(size > 0,
"InitializeProcThreadAttributeList() did not give a size"); "InitializeProcThreadAttributeList() did not give a size");
std::vector<uint8_t> buffer(size);
LPPROC_THREAD_ATTRIBUTE_LIST attributes = LPPROC_THREAD_ATTRIBUTE_LIST attributes =
reinterpret_cast<LPPROC_THREAD_ATTRIBUTE_LIST>(alloca(size)); reinterpret_cast<LPPROC_THREAD_ATTRIBUTE_LIST>(buffer.data());
CHECK_WIN32(InitializeProcThreadAttributeList(attributes, 1, 0, &size)); CHECK_WIN32(InitializeProcThreadAttributeList(attributes, 1, 0, &size));
defer(DeleteProcThreadAttributeList(attributes)); defer(DeleteProcThreadAttributeList(attributes));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment