You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Checkout the latest code from the git repository @ https://code.google.com/p/gperftools/
2. run autogen.sh script
3. run configure script
4. do make.
What is the expected output? What do you see instead?
Expect output would be a clean compilation. Instead one gets the following error:
clang++ -DHAVE_CONFIG_H -I. -I./src -I./src -D_THREAD_SAFE -Wall -Wwrite-strings
-Woverloaded-virtual -Wno-sign-compare -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc
-fno-builtin-calloc -fno-builtin-cfree -fno-builtin-memalign -fno-builtin-posix_memalign
-fno-builtin-valloc -fno-builtin-pvalloc -Wno-unused-result -fno-builtin -fno-builtin
-MT debugallocation_test-debugallocation_test.o -MD -MP -MF .deps/debugallocation_test-debugallocation_test.Tpo
-c -o debugallocation_test-debugallocation_test.o `test -f 'src/tests/debugallocation_test.cc'
|| echo './'`src/tests/debugallocation_test.cc
src/tests/debugallocation_test.cc:36:10: fatal error: 'malloc.h' file not found
#include <malloc.h> // for memalign
^
1 error generated.
What version of the product are you using? On what operating system?
checkout of master branch @ e7297f0c14b0c09ec52707ed7477c7aee43a1882, using Mac OS
X 10.9.2
Please provide any additional information below.
the commit a2375a1f360c0451ec2a2b852ea26a71fb731727 introduces malloc.h header file
on src/tests/debugallocation_test.cc in order to use memalign. I removed the include
of malloc.h and compilation went through. But it seems that malloc.h has been deprecated
on mac os and freebsd ( i guess ) .. and a patch like this would probably make sense(?):
diff --git a/src/tests/debugallocation_test.cc b/src/tests/debugallocation_test.cc
index 8e14830..dca087f 100644
--- a/src/tests/debugallocation_test.cc
+++ b/src/tests/debugallocation_test.cc
@@ -33,7 +33,9 @@
#include <stdio.h>
#include <stdlib.h>
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
#include <malloc.h> // for memalign
+#endif
#include <string.h> // for memcmp
#include <vector>
#include "gperftools/malloc_extension.h"
Reported by vguerra on 2014-04-04 11:42:33
The text was updated successfully, but these errors were encountered:
Originally reported on Google Code with ID 615
Reported by
vguerra
on 2014-04-04 11:42:33The text was updated successfully, but these errors were encountered: