Live data from Hacker News

ABI – Now or Never [pdf]

open-std.org

1–10 of 37 posts

Re: ABI – Now or Never [pdf]

#6
post #3
post #2

Discussion of whether the next (or any future) c++ release should break abi compatibility.

Does C++ have an ABI?

No, but it has a large number of implementing ABIs subject to complicated requirements. Both those explicit requirements upon ABIs and individual implementer decisions create legacy that conflicts with things that could make the language better.

Re: ABI – Now or Never [pdf]

#7
post #4

What is the "runtime overhead involved in passing unique_ptr by value"? The reference is a 1h YouTube video.

Short version: it passes a pointer to the pointer forcing a double indirection rather than a single.

Simple attempts to fix don't really work. Not even sure an ABI break will be enough, but it would at least be a minimum requirement.

Re: ABI – Now or Never [pdf]

#8
post #4

What is the "runtime overhead involved in passing unique_ptr by value"? The reference is a 1h YouTube video.

It's the overhead VS. passing a raw pointer. The itanium ABI says that std::unique_ptr has to be passed by address due to its special member functions (the ABI doesn't know if it stores a pointer to itself).

Compilers have an attribute to remove this overhead, but it's an ABI break to do it.

Re: ABI – Now or Never [pdf]

#9
post #4

What is the "runtime overhead involved in passing unique_ptr by value"? The reference is a 1h YouTube video.

It's the overhead VS. passing a raw pointer. The itanium ABI says that std::unique_ptr has to be passed by address due to its special member functions (the ABI doesn't know if it stores a pointer to itself). Compilers have an attribute to remove this overhead, but it's an ABI break to do it.

Thanks, I always assumed that a unique ptr was identical to a regular pointer under the hood.
Post reply on HN