Skip to content

Commit

Permalink
Add documentation for stack-size script
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Nov 14, 2024
1 parent da8d74f commit 8257c18
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion libcrux-ml-dsa/stack-sizes.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
#!/bin/bash

# This script runs `cargo stack-sizes` to obtain stack frame sizes for
# functions in the crate.
# functions in the crate. It
# - temporarily installs the cargo stack-sizes tool,
# - temporarily reconfigure the crate to the requirements of cargo
# stack-sizes (installs a minimal Rust nightly toolchain and sets a
# bogus `version` in Cargo.toml),
# - runs the stack-sizes tool on a given example.
#
# The script will then print all stack frame sizes it collects in
# increasing order and will exit normally if the FRAME_SIZE_LIMIT is
# not exceeded by any of them. If the limit is exceeded the script
# will error and print the name of the offending function.
#
# Before exiting, the script will restore the previous state of the
# crate and uninstall the stack-sizes tool.
#
# Usage:
#
# ./stack-sizes.sh <example>
#
# where <example> is an example program as you would run it with cargo
# run --example <example>.

set -euo pipefail

Expand Down

0 comments on commit 8257c18

Please sign in to comment.