This patch represents the ethos of D62233. It is much smaller and will hopefully be easier to review while still achieving the same result :)
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 41268 Build 41460: arc lint + arc unit
Event Timeline
Another friendly ping :) I would like to get this going because other patches rely on it. I have patches to resolve bugs, issues, and features. @mclow.lists @EricWF @ldionne
libcxx/include/memory | ||
---|---|---|
3982 | Before, we would create the control block with new, and with this patch we're using the allocator. Is this correct? Why? Also, we're now unconditionally using a try-catch block -- I'd be curious to see what the impact on code generation is. | |
4012 | Note to reviewers: It's okay to move this outside of the try-catch block, since __enable_weak_this is noexcept anyway. |
libcxx/include/memory | ||
---|---|---|
3982 | Yes, it's correct. The allocator will call __builtin_operator_new (or operator new), which makes it functionally equivalent. When the control block is deallocated, it calls __a.deallocate. I think it's better that the control block is also allocated with the allocator (even if they're functionally equivalent) both for cognitive load and in case we introduced an optimization (for example) that broke this type of deallocation down the road. I'll take a look at the codegen. |
libcxx/include/memory | ||
---|---|---|
3930 | I'm going to move the try-catch-blocks out of these two members and into the initializers they're used in. This should help with codegen. Also, I forgot to wrap these in the #ifs. |
Looking at it again, I'm not sure this patch is really needed. None of my other subsequent patches depend on it. If you want, I'm happy to abandon it. I do think it's not a bad cleanup, though. Anyway, I'd like to close it one way or another (either by committing it or by abandoning it).
cc @ldionne
I'm going to rebase D62259 off master instead of this patch. I'll close this patch for now if you think it would be a good change, I can re-open it later.
I'm going to move the try-catch-blocks out of these two members and into the initializers they're used in. This should help with codegen.
Also, I forgot to wrap these in the #ifs.