Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install mcpp
run: |
# ⚠️ A LOOP, BECAUSE ONE `xlings update` CAN RETURN A STALE INDEX
# A LOOP, BECAUSE ONE `xlings update` CAN RETURN A STALE INDEX
# WITHOUT SAYING SO.
#
# The index is published as an artifact behind a pointer, and that
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: The package builds for a freestanding target
run: mcpp build --target riscv64-none-elf

# ⚠️ The load-bearing check, and not "it compiled". These are REPLACEABLE
# The load-bearing check, and not "it compiled". These are REPLACEABLE
# functions: a definition that is present but not exported under the name
# the compiler emits would compile, link into nothing, and leave every
# consumer failing on `undefined symbol: operator new` exactly as before.
Expand All @@ -75,7 +75,7 @@ jobs:
echo "exported new/delete symbols: $n"
test "$n" -ge 12 || { "$NM" --defined-only "$OBJ"; echo "expected at least 12"; exit 1; }

# ⚠️⚠️ THE TWO DECLARATIONS THIS PACKAGE CARRIES MUST STILL BE openkal's,
# THE TWO DECLARATIONS THIS PACKAGE CARRIES MUST STILL BE openkal's,
# AND UNTIL NOW NOTHING SAID SO.
#
# `src/alloc.cpp` declares `kal_alloc` and `kal_free` itself rather than
Expand All @@ -86,7 +86,7 @@ jobs:
# changed either signature, this package would compile, link, and produce
# a silently wrong calling convention at the only place it matters.
#
# SO THE TWO ARE COMPILED TOGETHER, once, in a translation unit that
# SO THE TWO ARE COMPILED TOGETHER, once, in a translation unit that
# ships nowhere: openkal's header and this package's own declarations in
# the same scope. Disagreeing declarations of the same `extern "C"` name
# are a compile error that names them, which is the diagnostic wanted.
Expand All @@ -95,7 +95,7 @@ jobs:
set -euo pipefail
CXX=$(ls -d "$HOME"/.mcpp/registry/data/xpkgs/xim-x-llvm/*/bin/clang++ | head -1)

# ⚠️⚠️ THE VERSION IS NAMED, AND `head -1' OVER THE STORE IS NOT AN
# THE VERSION IS NAMED, AND `head -1' OVER THE STORE IS NOT AN
# ANSWER TO THIS QUESTION. The package store accumulates every openkal
# a build on this machine ever needed; the first spelling of this step
# globbed it and got 0.5.2 -- four minors behind the pin -- and
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
# A package that has only ever been built from Linux is a package whose
# consumers must use Linux, and nothing in these sources says so.
#
# ⚠️ A TOOLCHAIN AXIS IS ABSENT HERE, AND THAT IS MEASURED RATHER THAN
# A TOOLCHAIN AXIS IS ABSENT HERE, AND THAT IS MEASURED RATHER THAN
# ASSUMED. The row for a bare-metal triple names its compiler, and the
# command-line override does not displace it: `--toolchain gcc@16.1.0` on a
# `riscv64-none-elf` build resolves llvm@22.1.8 regardless. A matrix over
Expand All @@ -147,7 +147,7 @@ jobs:
# choice is real — openkal, whose declarations are compiled by three families
# on three systems.
#
# ⚠️ BUILD ONLY, AND DELIBERATELY. Behaviour is asserted once, above, under an
# BUILD ONLY, AND DELIBERATELY. Behaviour is asserted once, above, under an
# emulator. Booting the same image from three systems would be a statement
# about the emulator rather than about this package, and "the image does what
# the README says" does not become more true for having been observed from
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:

- name: Install mcpp
run: |
# ⚠️ A LOOP, BECAUSE ONE `xlings update` CAN RETURN A STALE INDEX
# A LOOP, BECAUSE ONE `xlings update` CAN RETURN A STALE INDEX
# WITHOUT SAYING SO.
#
# The index is published as an artifact behind a pointer, and that
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:

- name: The allocator cross-builds
run: |
# ⚠️ TWICE, AND THE FIRST IS ALLOWED TO FAIL — every row of this
# TWICE, AND THE FIRST IS ALLOWED TO FAIL — every row of this
# matrix is a machine that has never targeted this triple, which is
# precisely where mcpp's lazy install of the target C library shows.
# The first build compiles sources needing its headers before they
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ std-freestanding = { version = "0.3.1", features = ["alloc-kal"] }

That is the whole of the consumer's side.

⚠️ **0.3.1 and not 0.3.0.** The `[feature-deps]` entry in 0.3.0 named a version
**0.3.1 and not 0.3.0.** The `[feature-deps]` entry in 0.3.0 named a version
selector the resolver does not have, so the feature activated and its
implementation could not be fetched. A feature whose implementation cannot be
fetched is a feature that does not exist. The feature both states the
Expand Down Expand Up @@ -50,15 +50,15 @@ naming a mangled operator, which is the same defect with a worse message.
[openkal][kal] 0.9.0 declares them. On bare metal the board package supplies
them — the console and the heap region are board facts.

Those two are all this package reaches for, which is why it follows openkal's
Those two are all this package reaches for, which is why it follows openkal's
minor versions without changing: 0.9.0 withdrew `kal_io_result`, made the
capability words operations and added `kal_memory_granularity`, and none of that
is on the allocation path. The dependency is declared so that a mismatch is
reported when the graph resolves, and continuous integration compiles the two
declarations this package carries against the header they came from, because a
version dependency catches a version mismatch and not a signature one.

⚠️ The unsized `operator delete` overloads have no size to pass and give zero,
The unsized `operator delete` overloads have no size to pass and give zero,
which openkal defines as "not stated". An implementation that needs the size in
order to free must therefore record it itself; one built over a C library's
allocator, as the reference bare-metal backend is, does not.
Expand Down
6 changes: 3 additions & 3 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[package]
namespace = "mcpplibs"
name = "std-freestanding-alloc-kal"
version = "0.1.5"
version = "0.1.6"
description = "The replaceable allocation functions for the freestanding subset, forwarded to openkal"
license = "Apache-2.0"
authors = ["mcpplibs"]
Expand All @@ -21,12 +21,12 @@ provides = ["freestanding-allocator"]
# mismatch into a resolution-time message instead of a link-time one, and
# records what this package's twelve definitions are written against.
#
# ⚠️ An openkal IMPLEMENTATION is not declared here and must not be. Which
# An openkal IMPLEMENTATION is not declared here and must not be. Which
# implementation is present is a property of the target — on bare metal the
# board package supplies it, because the console address it writes to is a
# board fact. A dependency here would bind every consumer to one board.
[dependencies]
openkal = "0.12.0"
openkal = "0.13.0"

[build]
# The same reasoning openkal's own implementations record. No exception may
Expand Down
6 changes: 3 additions & 3 deletions src/alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// the standard specifies, written in the form a replacement implementation is
// expected to use.
//
// ⚠️ TWELVE, AND THE LAST FOUR ARE THE ONES THAT GET FORGOTTEN.
// TWELVE, AND THE LAST FOUR ARE THE ONES THAT GET FORGOTTEN.
//
// Measured on riscv64-none-elf: defining the eight sized and unsized forms
// leaves the link failing on `operator delete(void*, unsigned long,
Expand All @@ -47,15 +47,15 @@ void kal_free(void* p, size_type size, size_type align);
namespace {
// The alignment an unaligned allocation must satisfy.
//
// ⚠️ `__BIGGEST_ALIGNMENT__` and not `alignof(std::max_align_t)`: the latter
// `__BIGGEST_ALIGNMENT__` and not `alignof(std::max_align_t)`: the latter
// lives in <cstddef>, which would mean depending on the subset package and
// closing a cycle. The macro is predefined by both GCC and Clang and is the
// same quantity. Measured: `alignof(__max_align_t)` does not compile here at
// all — that identifier comes from <stddef.h>, which a package with no C
// library include path does not have.
constexpr size_type kDefaultAlign = __BIGGEST_ALIGNMENT__;

// ⚠️ Size and alignment are forwarded to `kal_free` because openkal's contract
// Size and alignment are forwarded to `kal_free` because openkal's contract
// requires them: an implementation may be a bump allocator, a slab, or a
// wrapper over the C library's, and only the first of those can ignore them.
// The unsized `operator delete` overloads have no size to pass and give zero,
Expand Down
Loading