Skip to content

Appendix: runtime function sizes

Auto-generated

The statistics and tables on this page are regenerated from DCCRTL.MAC every time the documentation is built, by the docs/docs/hooks/runtime_sizes.py MkDocs hook. They never go out of step with the runtime source, so prefer these numbers over any quoted elsewhere.

This page quantifies what each runtime library feature costs in code size once its transitive dependencies are linked. For how dccrtlstrip decides what to keep — and the optimisation takeaways for keeping a program small — see Runtime optimization.

How to read the numbers

The numbers are relative source-line counts, not exact bytes (blocks contain comments and blank lines). Use them to compare features and spot the heavyweights.

  • self — source lines in the function's own block.
  • marginalself plus every additional reachable block that is not already in the always-present baseline. This is the true incremental cost of using that function in a program that otherwise wouldn't need it.
  • pulls in — the extra runtime blocks added beyond the baseline.

Symbols are internal runtime labels

The Symbol column lists the internal assembler label, not the C name you call. For example __stchk is the stack-overflow guard linked by -fstack-check, __mlh is the malloc heap helper, and __pf_run is the shared printf engine. Searching this page for a feature word such as "stack" or "printf" may not match the symbol — look for the corresponding __ label instead (the pulls in column names related ones).

Runtime: DCCRTL.MAC

  • Total runtime lines: 20736
  • Preamble lines before the first public: 11
  • Parsed public blocks: 393
  • Always-present baseline: ~359 lines in 7 blocks

Formatted I/O (stdio.h)

Symbol self marginal pulls in
_pffio 383 ~3109 public_prelude, _printf, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, ...
_fprintf 76 ~1509 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_printf 24 ~791 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_sprintf 35 ~802 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_vprintf 26 ~793 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_vsprintf 35 ~802 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_vfprintf 74 ~1507 public_prelude, __pf_run/pf_loop/pf_percent/..., pf_arg_hl, pf_pad_a/pf_pad_loop, pf_zsetup/pf_zs_clrw/pf_zs_done, pf_efflen, pf_iprepad, pf_ipostpad, pf_zero_prec_blank, pf_zfd/pf_zfd_zloop/pf_zfd_print/..., pf_done, pf_emit_a/pfe_bufn/pfe_buf/..., ...
_puts 27 ~27 nothing beyond own block
__fpc 62 ~728 _errno, public_prelude, _write/wrloop/wrrd/..., __chkfd/cfbad, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, __chunk/ch_more128/ch_have_count/..., __advio/__extln/extln_diff/..., __zerdm, __mkfcb/mfspc/mfnam/..., ...
__fps 58 ~724 _errno, public_prelude, _write/wrloop/wrrd/..., __chkfd/cfbad, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, __chunk/ch_more128/ch_have_count/..., __advio/__extln/extln_diff/..., __zerdm, __mkfcb/mfspc/mfnam/..., ...
__pchr 13 ~13 nothing beyond own block

Console buffering control (stdio.h)

Symbol self marginal pulls in
_setvbuf 54 ~79 public_prelude, __cob_setbuf/csb_ok, __cobdflt
_setbuf 39 ~64 public_prelude, __cob_setbuf/csb_ok, __cobdflt
_fflush 11 ~11 nothing beyond own block

Console input (stdio.h)

Symbol self marginal pulls in
__gchr 33 ~758 __fgetc, _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, __chunk/ch_more128/ch_have_count/..., ...
__gtch 40 ~85 __kbht
__kbht 45 ~45 nothing beyond own block

Formatted input (scanf family)

Symbol self marginal pulls in
_fscanf 17 ~1473 __fgetc, __getc, __gchr, _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, ...
_scanf 17 ~1473 __fgetc, __getc, __gchr, _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, ...
_sscanf 17 ~1473 __fgetc, __getc, __gchr, _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, ...

Low-level file I/O

Symbol self marginal pulls in
_fread 84 ~1112 __fgetc, __gchr, __mulu, public_prelude, __udivmod/dms_rs0/dms_rs1/..., __divu/du_rhs_bad/du_miss_save, D16U/D16U0/D16U1/..., _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, ...
_fwrite 63 ~998 __mulu, public_prelude, __udivmod/dms_rs0/dms_rs1/..., __divu/du_rhs_bad/du_miss_save, D16U/D16U0/D16U1/..., _errno, public_prelude, _write/wrloop/wrrd/..., __chkfd/cfbad, __usep, __offp/__lenp/__rdsz, __fcbp, ...
_fgets 189 ~948 __fgetc, __gchr, _errno, public_prelude, _read/rdzero/rdfile/..., __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, ...
_fopen 50 ~451 _errno, public_prelude, _open/opfind/opslot/..., __usep, __offp/__lenp/__rdsz, __fcbp, __mkfcb/mfspc/mfnam/..., __enoent, __emfil, __nospc/__slot/__chnk/..., public_prelude, __rdcv, ...
_write 156 ~666 _errno, public_prelude, __chkfd/cfbad, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, __chunk/ch_more128/ch_have_count/..., __advio/__extln/extln_diff/..., __zerdm, __mkfcb/mfspc/mfnam/..., __ebadf, ...
_lseek 130 ~427 _errno, public_prelude, __chkfd/cfbad, __usep, __offp/__lenp/__rdsz, __fcbp, __mkfcb/mfspc/mfnam/..., __ebadf, __einval, __nospc/__slot/__chnk/..., public_prelude, __fduse, ...
_read 114 ~758 __fgetc, __gchr, _errno, public_prelude, __chkfd/cfbad, __rdhit/rdh_cmp/rdh_miss, __rdsto, __usep, __offp/__lenp/__rdsz, __fcbp, __setrr, __chunk/ch_more128/ch_have_count/..., ...
_open 122 ~399 _errno, public_prelude, __usep, __offp/__lenp/__rdsz, __fcbp, __mkfcb/mfspc/mfnam/..., __enoent, __emfil, __nospc/__slot/__chnk/..., public_prelude, __rdcv, __fduse, ...
_close 78 ~727 _errno, public_prelude, _open/opfind/opslot/..., _unlink/ulclr/ul_fail, __usep, __offp/__lenp/__rdsz, __fcbp, __mkfcb/mfspc/mfnam/..., __enoent, __ioerr, __ebadf, __emfil, ...
_unlink 39 ~190 _errno, public_prelude, __mkfcb/mfspc/mfnam/..., __enoent, __nospc/__slot/__chnk/...
_fclose 21 ~748 _errno, public_prelude, _open/opfind/opslot/..., _close/tmpf_cl_scan/tmpf_cl_clear/..., _unlink/ulclr/ul_fail, __usep, __offp/__lenp/__rdsz, __fcbp, __mkfcb/mfspc/mfnam/..., __enoent, __ioerr, __ebadf, ...

Memory (stdlib.h)

Symbol self marginal pulls in
_calloc 43 ~533 __wr_hf, __mulu, public_prelude, __udivmod/dms_rs0/dms_rs1/..., __divu/du_rhs_bad/du_miss_save, D16U/D16U0/D16U1/..., __ckmul, __mlh
__real 258 ~599 __wr_hf, __frcoal, __mlh
_malloc 11 ~232 __wr_hf, __mlh
_free 10 ~154 __wr_hf, __frcoal

16-bit integer and sort/search

Symbol self marginal pulls in
_qsort 147 ~201 __call_hl, __mulu
_bsearch 94 ~148 __call_hl, __mulu
__stol 13 ~1034 __mulu, _errno, __lmul, __ldu, __lmu, __lgu, __lmd, public_prelude, sc_isspace/SCL4/SCL8, sc_isdigit/SCL13/SCL21/..., __stou
__stou 492 ~1021 __mulu, _errno, __lmul, __ldu, __lmu, __lgu, __lmd, public_prelude, sc_isspace/SCL4/SCL8, sc_isdigit/SCL13/SCL21/...
_atol 117 ~117 nothing beyond own block
_atoi 66 ~66 nothing beyond own block
_rand 46 ~46 nothing beyond own block
_srand 9 ~55 _rand
_abs 17 ~17 nothing beyond own block
_labs 30 ~30 nothing beyond own block
_div 40 ~392 public_prelude, __udivmod/dms_rs0/dms_rs1/..., __divu/du_rhs_bad/du_miss_save, __modu/dm_both_pop/dm_miss, __divs/__ds_lpos/__ds_rpos/..., __mods/__ms_lpos/__ms_rpos/..., D16U/D16U0/D16U1/...
_ldiv 84 ~392 __lmu, __lds, __lmd

32-bit long arithmetic

Symbol self marginal pulls in
__lmul 119 ~196 __mulu, __lmd
__lds 74 ~308 __lmu, __lmd
__lms 75 ~309 __lmu, __lmd
__ldu 23 ~257 __lmu, __lmd
__lmu 207 ~234 __lmd
__lts 41 ~41 nothing beyond own block
__ltu 30 ~30 nothing beyond own block

Float operators and conversions

Symbol self marginal pulls in
__fadd 9 ~908 __fsub, __fdiv
__fmul 442 ~1496 __m1u, __m8u, __fsub, __fdiv
__fdiv 371 ~899 __fsub
__flt - - not found
__feq - - not found
__fif 15 ~46 __fuf
__ffi 29 ~66 __ffu
__flf 28 ~64 __fulf
__ffl 41 ~91 __fful

math.h float functions

Symbol self marginal pulls in
_powf 234 ~3406 __m1u, __m8u, __fzro, __fnan, __finf, __feqf, __fnef, __fcmpsf, __fltf, __fgtf, __flef, __fuf, ...
_tanhf 110 ~2740 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __flef, __faf, __fsf, __fsub, __fmf, ...
_sinhf 47 ~2787 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __flef, __faf, __fsf, __fsub, __fmf, ...
_coshf 46 ~2786 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __flef, __faf, __fsf, __fsub, __fmf, ...
_expf 256 ~2482 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __flef, __faf, __fsf, __fsub, __fmf, ...
_tanf 256 ~2565 __m1u, __m8u, __fnan, __finf, __feqf, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, ...
_acosf 25 ~2576 __m1u, __m8u, __fzro, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, ...
_atan2f 258 ~2520 __m1u, __m8u, __fnan, __finf, __feqf, __fcmpsf, __fltf, __fgtf, __flef, __faf, __fsf, __fsub, ...
_log10f 26 ~2376 __m1u, __m8u, __fzro, __fnan, __finf, __fcmpsf, __fgtf, __fuf, __fif, __faf, __fsf, __fsub, ...
_asinf 298 ~2551 __m1u, __m8u, __fzro, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, ...
_logf 223 ~2350 __m1u, __m8u, __fzro, __fnan, __finf, __fcmpsf, __fgtf, __fuf, __fif, __faf, __fsf, __fsub, ...
_cosf 231 ~2440 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, __fmul, ...
_sinf 207 ~2416 __m1u, __m8u, __fnan, __finf, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, __fmul, ...
_atanf 232 ~2106 __m1u, __m8u, __fcmpsf, __fltf, __fgtf, __faf, __fsf, __fsub, __fmf, __fmul, __fdf, __fdiv
_sqrtf 219 ~2199 __m1u, __m8u, __fzro, __fnan, __finf, __fcmpsf, __fltf, __faf, __fsf, __fsub, __fmf, __fmul, ...
_modff 132 ~1376 __finf, __fcmpsf, __flef, __fsf, __fsub, __fdiv, public_prelude, _floorf, _ceilf, __frint/frint_right/frint_floor_adjust/..., public_prelude
_fmodf 336 ~376 __fnan, __finf
_ldexpf 141 ~181 __fnan, __finf
_nextafterf 243 ~493 __fzro, __fnan, __feqf, __fcmpsf, __fltf
_floorf 11 ~110 public_prelude, __frint/frint_right/frint_floor_adjust/...
_ceilf 15 ~114 public_prelude, __frint/frint_right/frint_floor_adjust/...
_frexpf 105 ~145 __fnan, __finf
_fabsf 13 ~19 __fabs

string.h / ctype.h

Symbol self marginal pulls in
__sdup 44 ~290 __wr_hf, __slf, _malloc, __mlh
__sstr 116 ~116 nothing beyond own block
__stok 111 ~197 __spbr, __sspn
__mset 44 ~44 nothing beyond own block
__mcpy 33 ~33 nothing beyond own block
__scpy 24 ~24 nothing beyond own block
__slen 18 ~32 __slf
__caa 20 ~20 nothing beyond own block
__ctu 21 ~21 nothing beyond own block
__schr 45 ~45 nothing beyond own block
__srch 35 ~35 nothing beyond own block
__mcmp 89 ~89 nothing beyond own block
__mchr 26 ~26 nothing beyond own block

CP/M extensions and misc

Symbol self marginal pulls in
_perror 59 ~125 _strerror, _errno
_dopn 73 ~90 _dcls
_drd 99 ~116 _dcls
_strerror 62 ~62 nothing beyond own block
_setjmp 44 ~44 nothing beyond own block
_longjmp 85 ~85 nothing beyond own block
_bdos 11 ~39 __bdosf
_inp 15 ~15 nothing beyond own block
_outp 18 ~18 nothing beyond own block
__stchk 72 ~72 nothing beyond own block