Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/heapusage
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# heapusage is distributed under the BSD 3-Clause license, see LICENSE for details.

HU_VER="2.37"
HU_VER="2.38"

showusage()
{
Expand Down
2 changes: 1 addition & 1 deletion src/heapusage.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
.TH HEAPUSAGE "1" "June 2026" "heapusage v2.37" "User Commands"
.TH HEAPUSAGE "1" "June 2026" "heapusage v2.38" "User Commands"
.SH NAME
heapusage \- find memory leaks in applications
.SH SYNOPSIS
Expand Down
8 changes: 4 additions & 4 deletions src/hulog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void log_event(int event, void* ptr, size_t size)

log_print_callstack(f, callstack_depth, callstack);

fprintf(f, "%s Address %p is a block of size %ld free'd at:\n",
fprintf(f, "%s Address %p is a block of size %zu free'd at:\n",
hu_prefix, ptr, allocation->second.size);

log_print_callstack(f, allocation->second.free_callstack_depth,
Expand Down Expand Up @@ -378,7 +378,7 @@ void hu_sig_handler(int sig, siginfo_t* si, void* /*ucontext*/)
found = true;
size_t offset = (char*)ptr - ((char*)allocation->second.ptr + allocation->second.size);

fprintf(f, "%s Address %p is %ld bytes after a block of size %ld alloc'd at:\n",
fprintf(f, "%s Address %p is %zu bytes after a block of size %zu alloc'd at:\n",
hu_prefix, ptr, offset, allocation->second.size);

log_print_callstack(f, allocation->second.callstack_depth, allocation->second.callstack);
Expand All @@ -397,7 +397,7 @@ void hu_sig_handler(int sig, siginfo_t* si, void* /*ucontext*/)
found = true;
size_t offset = (char*)ptr - ((char*)allocation->second.ptr + allocation->second.size);

fprintf(f, "%s Address %p is %ld bytes after a block of size %ld free'd at:\n",
fprintf(f, "%s Address %p is %zu bytes after a block of size %zu free'd at:\n",
hu_prefix, ptr, offset, allocation->second.size);

log_print_callstack(f, allocation->second.free_callstack_depth,
Expand All @@ -413,7 +413,7 @@ void hu_sig_handler(int sig, siginfo_t* si, void* /*ucontext*/)
found = true;
size_t offset = (char*)ptr - ((char*)allocation->second.ptr);

fprintf(f, "%s Address %p is %ld bytes inside a block of size %ld free'd at:\n",
fprintf(f, "%s Address %p is %zu bytes inside a block of size %zu free'd at:\n",
hu_prefix, ptr, offset, allocation->second.size);

log_print_callstack(f, allocation->second.free_callstack_depth,
Expand Down
7 changes: 4 additions & 3 deletions src/humalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/* ----------- Includes ------------------------------------------ */
#include <atomic>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <iostream>
#include <fstream>
Expand Down Expand Up @@ -103,7 +104,7 @@ static int hu_mprotect(void* addr, size_t len, int prot)
int rv = mprotect(addr, len, prot);
if (rv != 0)
{
fprintf(stderr, "heapusage error: mprotect(%p, %ld, %d) failed errno %d\n",
fprintf(stderr, "heapusage error: mprotect(%p, %zu, %d) failed errno %d\n",
addr, len, prot, errno);

#if defined(__linux__)
Expand All @@ -117,9 +118,9 @@ static int hu_mprotect(void* addr, size_t len, int prot)
if (callcount > (max_map_count / 2))
{
fprintf(stderr,
"max_map_count=%ld mprotect_count=%ld, try increasing max_map_count, ex:\n",
"max_map_count=%" PRIu64 " mprotect_count=%" PRIu64 ", try increasing max_map_count, ex:\n",
max_map_count, callcount);
fprintf(stderr, "sudo sh -c \"echo %ld > /proc/sys/vm/max_map_count\"\n",
fprintf(stderr, "sudo sh -c \"echo %" PRIu64 " > /proc/sys/vm/max_map_count\"\n",
(2 * max_map_count));
exit(1);
}
Expand Down
Loading