summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-03-29 23:47:08 (GMT)
committerJason Evans <jasone@canonware.com>2014-03-29 23:47:08 (GMT)
commit9480a230054f6c2f2c816fe887147456bd89409b (patch)
tree76aecd50dc266c3ce620ae98b8ffea762d78396e /src
parent57fb8e94ae941ddffc0877714d0539f8999e5ded (diff)
parentc2da2591befa5574cf8c930a5a2cd7f56138658e (diff)
downloadjemalloc-9480a230054f6c2f2c816fe887147456bd89409b.zip
jemalloc-9480a230054f6c2f2c816fe887147456bd89409b.tar.gz
jemalloc-9480a230054f6c2f2c816fe887147456bd89409b.tar.bz2
Merge pull request #59 from HarryWeppner/dev
FreeBSD memory (leak) profiling support
Diffstat (limited to 'src')
-rw-r--r--src/prof.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/prof.c b/src/prof.c
index 1d8ccbd..7722b7b 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -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;