C++ Logo

std-proposals

Advanced search

Re: [std-proposals] ABI

From: Bjorn Reese <breese_at_[hidden]>
Date: Sun, 21 Jul 2024 19:02:56 +0200
On 7/21/24 17:51, Hans via Std-Proposals wrote:

> I want to be able to mark some datastructures as guaranteed-stable, and
> for the rest of the datastructures to have no stability guarantee.
Have you considered a more radical approach, where these ABI classes
only holds data? They may have constructors, destructors, and simple
accessors, but nothing else. These ABI classes are wrapped by API
classes that holds the functionality. The ABI classes must be easy
to move to API classes. Alternatively, or complementarily, the
functionality may reside in standalone functions.

This allows the addition and removal of functionality without affecting
the ABI.

For instance, an ABI string would be a dynamic array of characters.

A disadvantage is that small-object optimization becomes more difficult.
The API string class could still use small-buffer optimization
internally, but this buffer must be copied to the ABI class when used
across ABI boundaries.

Received on 2024-07-21 17:03:00