Why do my format routine parameters (usually) have to be pointers to the type logged?
The short answer is, “Because that’s how it works.” There are two real reasons. The first has to do with the whole logging/formatting concept. Data is copied to a memory-mapped file when logged. When formatting, we memory-map the APD file. To pass the data to the format routine directly, we’d have to allocate temporary space of the right size and copy it again. It’s much more elegant to pass everything — scalars, structs, and arrays — by pointer. That way, when you log an `int’ value, you write it to the APD file, and when you format it, you just pass its address in the memory-mapped apd file directly to the format routine. This allows ints, arrays of ints, and structs to all work the same way. The second reason is related to the first, and has to do with the fact the C doesn’t have an array “type”, but rather treats any adjacent locations in memory as an array. Here’s what our chief designer has to say on this subject: When designing the APC extensions such as ‘log’ statements we ha