bnoordhuis/node-heapdump — pull request #11 by aahoughton (2013-05-26 14:53:10+00:00)
Title: multiple processes in the same root write indistinguishable snapshots

.. I suppose another way of handling this would be to allow passing of a base filename. In any case:

There's no easy way to distinguish snapshots from different processes started in the same hierarchy, and there's some (small) chance that they'd overwrite each other's snapshots. I added a distinguishing PID to the filename, which uses the parent's PID on UNIX and (hopefully, I have no way to test) the process' own PID on win32.

Win32 and posix differ in PIDs -- win32 uses DWORD (unsigned long), posix PIDs are signed -- so there's some chance that win32 users would see negative PIDs after my cast to long.. fixing that generically moves logic around too much, I'm leaving that as-is.