Repository navigation
Conversation
3ce6749 to
79f1d00
Compare
|
Confirmed that this works on Apple OSes older than what CI provides (macOS 11 with clang++ 22, and Mac OS X 10.8 with g++ 14, both available on MacPorts). |
ISSOtm
left a comment
There was a problem hiding this comment.
I do not like the extra allocation and indirection that this change performs without simplifying the code, so I'd rather not but I won't veto this either.
@ISSOtm Can you explain further? What extra allocation? And what would you do differently to simplify this code? Or if you think that using |
|
Right now I don't see this providing a worthwhile improvement, yeah. |
C++
std::shared_ptr"can share ownership of an object while storing a pointer to another object" (cppreference). We were taking advantage of this insidemakeCaptureto have pointers to a captured rept/macro body at some offset inside an owned vector. However, this is arguably nontrivial/surprising use of C++ features. Furthermore, we couldn't usecontent.ptr = std::make_shared<char[]>(size)(cppreference) because of insufficient platform support (despite being part of C++20, it was added only in gcc 12 and clang 15), so we had to usestd::shared_ptr<char[]>(new char[size]). So that will be one more thing I can check off of #2003.