Removed void arguments.
Updated for FreeBSD.
Changed to actually allocate memory; different from original approach.
Slight mod for FreeBSD.
Removed iostream include.
Removed (void).
Added internal buffer allocation just in case (required for FreeBSD).
Fixed cleanup; added FreeBSD as target with __thread support.