How about:
```D
ulong mult = 100 + (1000UL) / bsr(curLen * TSizeOf + 1);
```
instead? This implicitly supports a `curLen` of 0.

EIther that, or if we explicitly test for "not yet allocated", we could also make sure the first allocation is at least a certain amount of bytes (say 64?): In the generic case, the very first time this function is called, it is with the arguments `appenderNewCapacity(0, 1)`, which then answers "The optimal allocation size is 1". Subsequently, it'll say to allocate "2", then "4" etc... very sub-optimal.

```D
if(curLen == 0)
    return max(reqLen, 64 / TSizeOf);
```