Commit f0932b7a authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

More hacking on dlmalloc. Addresses #1032, #1328, #1343.

git-svn-id: file:///svn/toku/tokudb.1032b+1343@8476 c7de825b-a66e-492c-adef-691d508d4ae1
parent d7fa1f80
......@@ -286,7 +286,7 @@ int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")))
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void *(*)(void*)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -302,7 +302,7 @@ int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")))
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void *(*)(void*)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -308,7 +308,7 @@ int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")))
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void *(*)(void*)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -308,7 +308,7 @@ int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")))
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void *(*)(void*)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -313,7 +313,7 @@ int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")))
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void *(*)(void*)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -356,7 +356,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
printf("int toku_close_trace_file (void) %s;\n", VISIBLE);
printf("int db_env_set_func_malloc (void *(*)(size_t)) %s;\n", VISIBLE);
printf("int db_env_set_func_realloc (void *(*)(void*, size_t)) %s;\n", VISIBLE);
printf("int db_env_set_func_free (void *(*)(void*)) %s;\n", VISIBLE);
printf("int db_env_set_func_free (void (*)(void*)) %s;\n", VISIBLE);
printf("#if defined(__cplusplus)\n}\n#endif\n");
printf("#endif\n");
return 0;
......
......@@ -306,6 +306,9 @@ int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("d
int db_env_set_func_fsync (int (*)(int)) __attribute__((__visibility__("default")));
int toku_set_trace_file (char *fname) __attribute__((__visibility__("default")));
int toku_close_trace_file (void) __attribute__((__visibility__("default")));
int db_env_set_func_malloc (void *(*)(size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_realloc (void *(*)(void*, size_t)) __attribute__((__visibility__("default")));
int db_env_set_func_free (void (*)(void*)) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
......@@ -72,7 +72,10 @@ extern "C" {
// Deprecated functions.
#if !defined(TOKU_ALLOW_DEPRECATED)
# if defined(__ICL) //Windows Intel Compiler
# pragma deprecated (fstat, getpid, syscall, sysconf, mkdir, strdup, malloc, free)
# pragma deprecated (fstat, getpid, syscall, sysconf, mkdir, strdup);
# ifndef DONT_DEPRECATE_MALLOC
# pragma deprecated (malloc, free, realloc)
# endif
# else
int fstat() __attribute__((__deprecated__));
int getpid(void) __attribute__((__deprecated__));
......@@ -85,9 +88,11 @@ int mkdir() __attribute__((__deprecated__));
char* strdup(const char *) __attribute__((__deprecated__));
#undef __strdup
char* __strdup(const char *) __attribute__((__deprecated__));
#ifndef DONT_DEPRECATE_MALLOC
void *malloc(size_t) __attribute__((__deprecated__));
void free(void*) __attribute__((__deprecated__));
void *realloc(void*, size_t) __attribute__((__deprecated__));
#endif
# endif
#endif
......
......@@ -124,6 +124,6 @@ void maybe_preallocate_in_file (int fd, u_int64_t size);
int toku_set_func_fsync (int (*fsync_function)(int));
int toku_set_func_malloc (void *(*)(size_t));
int toku_set_func_realloc (void *(*)(void*,size_t));
int toku_set_func_free (void *(*)(void*));
int toku_set_func_free (void (*)(void*));
#endif
......@@ -7,6 +7,7 @@
log_compare;
db_env_set_func_fsync;
db_env_set_func_malloc;
db_env_set_func_realloc;
db_env_set_func_free;
toku_get_maxrss;
......@@ -30,6 +31,10 @@
toku_realloc;
toku_strdup;
dlmalloc;
dlrealloc;
dlfree;
local: *;
};
......@@ -3661,6 +3661,6 @@ int db_env_set_func_malloc (void *(*f)(size_t)) {
int db_env_set_func_realloc (void *(*f)(void*, size_t)) {
return toku_set_func_realloc(f);
}
int db_env_set_func_free (void *(*f)(void*)) {
int db_env_set_func_free (void (*f)(void*)) {
return toku_set_func_free(f);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment