stan-dev/stan — pull request #474 by bob-carpenter (2014-01-01 22:06:38+00:00)
Title: Bugfix/issue 472 softmax leak

Summary: Fixes #472, memory leak in `agrad::softmax()` function in `agrad/rev/matrix/softmax.hpp`

Intended Effect: As summarized, plus new function `memory::stack_alloc::bytes_allocated` with tests to support testing the fix

Side Effect: tests for softmax are now brittle due to dependency on stack_alloc initial block size and block growth and the particular data structures used in softmax; I didn't know how to test any other way.

How to Verify: Run test in old version (fails), run in new version (passes). Alternatively, run a bunch of loops computing softmax in old version and monitor memory to see leak; run in new version to see it plugged.

* [ ] code review
* [ ] kick off integration testing