smalloc: length is byte size, not array length

The C++ API has been changed so the passed length is the byte size of
the data, not the length of the array.

This was done so users need to explicitly define how much memory they
want allocated.
smalloc: consistent-ify syntax

Small syntax fixes of variable renaming and argument alignment.