mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-17 16:11:42 +03:00
Enable profiling / leak detection in FreeBSD
* Assumes procfs is mounted at /proc, cf. <http://www.freebsd.org/doc/en/articles/linux-users/procfs.html>
This commit is contained in:
parent
9e20df163c
commit
bf543df20c
2 changed files with 27 additions and 3 deletions
|
|
@ -11,6 +11,12 @@
|
|||
#include <unwind.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define PROCESS_VMEM_MAP "/proc/curproc/map"
|
||||
#else
|
||||
#define PROCESS_VMEM_MAP "/proc/%d/maps"
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Data. */
|
||||
|
||||
|
|
@ -936,7 +942,7 @@ prof_dump_maps(bool propagate_err)
|
|||
|
||||
cassert(config_prof);
|
||||
|
||||
malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps",
|
||||
malloc_snprintf(filename, sizeof(filename), PROCESS_VMEM_MAP,
|
||||
(int)getpid());
|
||||
mfd = open(filename, O_RDONLY);
|
||||
if (mfd != -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue