Factor out HUNK allocation into a function of its own.