Merge pull request #59 from HarryWeppner/dev

FreeBSD memory (leak) profiling support
This commit is contained in:
Jason Evans
2014-03-29 16:47:08 -07:00
2 changed files with 31 additions and 4 deletions

View File

@@ -935,9 +935,12 @@ prof_dump_maps(bool propagate_err)
char filename[PATH_MAX + 1];
cassert(config_prof);
#ifdef __FreeBSD__
malloc_snprintf(filename, sizeof(filename), "/proc/curproc/map");
#else
malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps",
(int)getpid());
#endif
mfd = open(filename, O_RDONLY);
if (mfd != -1) {
ssize_t nread;