C++ Logo

std-proposals

Advanced search

Re: [std-proposals] ABI

From: zxuiji <gb2985_at_[hidden]>
Date: Fri, 12 Jul 2024 17:41:39 +0100
On Fri, 12 Jul 2024 at 15:47, Henry Miller via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> I don't want to pay for the costs to convert to the standard ABI and back
> just because somebody might in the future change the ABI of string or
> vector.
>

That's not a reason to implement a standard ABI, that's a reason to not use
the standard ABI, a bad one at that. Remember my point about making classes
with no standard ABI inherit from ones that do? There's no reason
std::string could not inherit from say std::stable:: linked_list_string on
said mythical cpu. You would still get your performance gains without
sacrificing a standard ABI in the process. The point of a standard ABI is
to ensure functions and data in said ABI follow the same size definitions.
For example intmax_t related functions just need to be inlines that call
the correct functions matching the current size of intmax_t. A standard ABI
does not mean optimisations cannot be applied to the implementation of the
ABI, only that the data and calls will be of a fixed size.

Received on 2024-07-12 16:34:36