diff --git a/core/config.h b/core/config.h index 0a77ec949..874276666 100644 --- a/core/config.h +++ b/core/config.h @@ -470,8 +470,23 @@ * 200 bytes (release build, macOS/amd64) * 2600 bytes (debug build, macOS/amd64) * - * libc snprintf (used by eg. wasm_runtime_set_exception) consumes about - * 1600 bytes stack on macOS/amd64, about 2000 bytes on Ubuntu amd64 20.04. + * - platform-provided functions (eg. libc) + * + * the following are examples of the stack consumptions observed for + * host APIs. + * + * snprintf: (used by eg. wasm_runtime_set_exception) + * - about 1600 bytes on macOS/amd64 + * - about 2000 bytes on Ubuntu amd64 20.04 + * + * gethostbyname: + * - 3KB-6KB on macOS/amd64 + * - 10KB on Ubuntu amd64 20.04 + * + * getaddrinfo: + * - 4KB-17KB on macOS/amd64 + * - 12KB on Ubuntu amd64 20.04 + * - 0.3-1.5KB on NuttX/esp32s3 * * - stack check wrapper functions generated by the aot compiler * (--stack-bounds-checks=1) @@ -480,6 +495,9 @@ * "precheck functions themselves consume relatively large amount of stack" * when it detects wrapper functions requiring more than 1KB. * + * - the ABI-defined red zone. eg. 128 bytes for SYSV x86-64 ABI. + * cf. https://en.wikipedia.org/wiki/Red_zone_(computing) + * * Note: on platforms with lazy function binding, don't forget to consider * the symbol resolution overhead on the first call. For example, * on Ubuntu amd64 20.04, it seems to consume about 1500 bytes.