Skip to content

Commit 746fb3c

Browse files
miss-islingtonwoodruffw
authored andcommitted
Adjust stable ABI internal documentation (GH-96896)
I was perusing this file, and noticed that this part of the documentation is slightly out of date: the `struct` items in this TOML file currently contain `struct_abi_kind` members, which distinguish between the different types of ABI compatibility described in the comment. I've updated the comment to reflect this. (cherry picked from commit 6e53308) Co-authored-by: William Woodruff <[email protected]>
1 parent e232e49 commit 746fb3c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Misc/stable_abi.toml

+14-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@
1313
# The current format is TOML.
1414

1515
# There are these kinds of top-level "items":
16-
# - struct: A C struct. Currently this file does not distinguish between:
17-
# - opaque structs, which the Limited API only handles via pointers
18-
# (so these can change at any time)
19-
# - structs where only certain members are part of the stable ABI (e.g.
20-
# PyObject)
21-
# - structs which must not be changed at all (e.g. PyType_Slot, which is
22-
# fully defined and used in arrays)
16+
# - struct: A C struct. See `struct_abi_kind` for how much of the struct is
17+
# exposed.
2318
# - function: A function that must be kept available (and exported, i.e. not
2419
# converted to a macro).
2520
# - const: A simple value, defined with `#define`.
@@ -42,6 +37,18 @@
4237
# of the stable ABI.
4338
# - a combination of the above (functions that were called by macros that
4439
# were public in the past)
40+
# - struct_abi_kind: for `struct`, defines how much of the struct is exposed:
41+
# - 'full-abi': All of the struct is part of the ABI, including the size
42+
# (users may define arrays of these structs).
43+
# Typically used for initalization, rather than at runtime.
44+
# - 'opaque': No members are part of the ABI, nor is the size. The Limited
45+
# API only handles these via pointers. The C definition should be
46+
# incomplete (opaque).
47+
# - 'members': Only specific members are part of the stable ABI.
48+
# The struct's size may change, so it can't be used in arrays.
49+
# Do not add new structs of this kind without an extremely good reason.
50+
# - members: For `struct` with struct_abi_kind = 'members', a list of the
51+
# exposed members.
4552
# - doc: for `feature_macro`, the blurb added in documentation
4653
# - windows: for `feature_macro`, this macro is defined on Windows.
4754
# (This info is used to generate the DLL manifest and needs to be available

0 commit comments

Comments
 (0)