diff --git a/include/jemalloc/internal/prof_externs.h b/include/jemalloc/internal/prof_externs.h index e5d6ff7b..d644be64 100644 --- a/include/jemalloc/internal/prof_externs.h +++ b/include/jemalloc/internal/prof_externs.h @@ -96,6 +96,8 @@ size_t prof_tdata_count(void); size_t prof_bt_count(void); typedef int (prof_dump_open_file_t)(const char *, int); extern prof_dump_open_file_t *JET_MUTABLE prof_dump_open_file; +typedef ssize_t (prof_dump_write_file_t)(int, const void *, size_t); +extern prof_dump_write_file_t *JET_MUTABLE prof_dump_write_file; typedef bool (prof_dump_header_t)(tsdn_t *, bool, const prof_cnt_t *); extern prof_dump_header_t *JET_MUTABLE prof_dump_header; typedef int (prof_dump_open_maps_t)(); diff --git a/src/prof_data.c b/src/prof_data.c index b9b211d4..0de728b0 100644 --- a/src/prof_data.c +++ b/src/prof_data.c @@ -488,6 +488,8 @@ prof_dump_open(bool propagate_err, const char *filename) { return fd; } +prof_dump_write_file_t *JET_MUTABLE prof_dump_write_file = malloc_write_fd; + static bool prof_dump_flush(bool propagate_err) { bool ret = false; @@ -495,10 +497,11 @@ prof_dump_flush(bool propagate_err) { cassert(config_prof); - err = malloc_write_fd(prof_dump_fd, prof_dump_buf, prof_dump_buf_end); + err = prof_dump_write_file(prof_dump_fd, prof_dump_buf, + prof_dump_buf_end); if (err == -1) { if (!propagate_err) { - malloc_write(": write() failed during heap " + malloc_write(": failed to write during heap " "profile flush\n"); if (opt_abort) { abort();