Proven C Book←↑

Detailed contents

The contents opened out to the section level --- for going straight to a place.

Part I — Ground: the machine and its memory

Part II — What the machine really is: representation and execution

Part III — The first program

Part IV — A minimal toolbox

Part V — Declarations: how names are made

Part VI — Values and control

Part VII — Memory

Part VIII — The shape of data

Part IX — Deep corners

Part X — Structure and linkage: from files to declarations

Part XI — Object-oriented programming imitated in C

Part XII — Reading the standard library

Part XIII — proven — a new, stable foundation

Part XIV — Closing

Front and back matter

<string.h> — strings and memoryWorking on blocks of memory (mem*)Copying and joining (strcpy and strcat families)Comparing, and lengthSearching and splittingError strings<ctype.h> — the kinds of a single byte<stdckdint.h> — arithmetic that answers about overflow<assert.h> — checking a contract while it runs<errno.h> — where a failure leaves its reason<setjmp.h> — writing down a place to come back to<stdarg.h> — walking arguments whose number is unknown<stddef.h> — names for the things that had none<stdbool.h> and <stdalign.h> — the two headers that emptied out<iso646.h> and <stdnoreturn.h> — one scar and one retired name<limits.h> — where the integers end<float.h> — where the reals end<stdint.h> — integers with the width nailed down<inttypes.h> — printing and reading those integers<stdbit.h> — counting bits, the standard way<locale.h> — changing whose conventions apply<wctype.h> — the kinds of a wide character<uchar.h> — characters with the Unicode width nailed down<signal.h> — interruption from outside<fenv.h> — reaching into the floating-point environment<tgmath.h> — it picks the one that fits the type<complex.h> — complex numbers<threads.h> — the standard’s own threads<stdatomic.h> — operations that cannot be split<wchar.h> — everything about wide characters<time.h> — instants and durations<stdlib.h> — the drawer of odds and ends<stdio.h> — stream input and output<math.h> — the mathematical functions
Why measure — with concepts alone, what remains is wrong intuitionMeasure the measuring instrument first1. The example reads the machine’s numbers itself2 and 3. Resolution and call cost are different things4. The first trap — the optimiser removes what you meant to measure5. The second trap — the first round is slow6. The third trap — one interruption drags the meanThe six disciplines of this appendixMeasuring the memory ladderFirst the principle — why a ladder appearedSo how must it be measuredWhat was measured — the steps appearLines and strides — the unit a cache fetchesFirst the principle — why a line and not a single itemThe method — vary the stride, fix the countWhat was measured — the line appears in the timeThe same data, laid out differently — AoS and SoAAddress translation has a cost too — the TLB and pagesFirst the principle — the translation table and its cacheThe method — little data, many pagesThree things measuredThe cost of a fork in the road — branch predictionFirst the principle — why the machine must guessBefore measuring — is there still a branchWhat was measuredHow regular must it be to be predictedThe cost between cores — false sharing and atomicsFirst the principle — a line belongs to one core at a timeFalse sharing — I slow down because of somebody else’s variableWhat was measuredReally shared values — atomics and locksThe cost of numbers — floating pointFirst, this section’s measurement failed onceMeasured 1 — denormals were 72 times slowerMeasured 2 — is float faster than double?Measured 3 — the operations cost differentlyEverything measured, in one placeMeasured again on real ARM hardwareHow to use these numbersWhat to take from this