Simplify. Temporary variable "i" is removed.
Extract stack zero filling to stack_clear(). Porting evelopers can optimize by replacing to memset() on their own risk.
Merge pull request #1002 from monaka/pr-extract-stack-zero-filling

Extract stack zero filling into new function.