We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1e6f49 commit 91b15c4Copy full SHA for 91b15c4
src/memory-analyzer/gdb_api.cpp
@@ -10,6 +10,11 @@ Author: Malte Mues <[email protected]>
10
/// \file
11
/// Low-level interface to gdb
12
13
+#ifdef __linux__
14
+# include <malloc.h>
15
+#elif __APPLE__
16
+# include <malloc/malloc.h>
17
+#endif
18
19
#include <cctype>
20
#include <cerrno>
@@ -59,7 +64,15 @@ gdb_apit::~gdb_apit()
59
64
60
65
size_t gdb_apit::query_malloc_size(const std::string &pointer_expr)
61
66
{
67
62
68
write_to_gdb("-var-create tmp * malloc_usable_size(" + pointer_expr + ")");
69
70
+ write_to_gdb("-var-create tmp * malloc_size(" + pointer_expr + ")");
71
+#else
72
+ // Under non-linux/OSX system we simple return 1, i.e. as if the \p
73
+ // pointer_expr was not dynamically allocated.
74
+ return 1;
75
63
76
77
if(!was_command_accepted())
78
0 commit comments