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

Candidate fix for #1374 (wrong db.h include file for BDB versions of code.) Addresses #1374.

git-svn-id: file:///svn/toku/tokudb@8667 c7de825b-a66e-492c-adef-691d508d4ae1
parent cf8e664a
......@@ -3,7 +3,7 @@
.DEFAULT_GOAL= default
TOKUROOT=./
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
default: build
SRCDIRS = $(OS_CHOICE) newbrt src cxx utils db-benchmark-test db-benchmark-test-cxx
......
......@@ -10,7 +10,7 @@ DEPEND_COMPILE += \
#end
HERE = cxx
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
#
#
# OPTFLAGS = -O2
......
......@@ -11,7 +11,7 @@ DEPEND_COMPILE += \
#end
HERE = cxx/tests
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
SHOULD_FAIL =
$(SHOULD_FAIL): MAYBEINVERTER=;test $$? -ne 0
......@@ -31,7 +31,7 @@ TARGETS = $(patsubst %.cpp,%,$(SRCS))
# OPTFLAGS = -O0
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CPPFLAGS = -I../ -I../../include -I../../linux
CPPFLAGS = -I../ -I../../include -I../../linux -I$(TOKUROOT)toku_include
CXXFLAGS = -Wall $(OPTFLAGS) -g $(GCOV_FLAGS)
LDLIBS = ../../lib/libtokudb_cxx.a ../../lib/libtokudb.a -lz -lpthread
......
......@@ -16,7 +16,7 @@ DEPEND_COMPILE += \
SKIP_NORETURN=1 #Do not add the -Wmissing-noreturn flag
HERE = db-benchmark-test-cxx
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb
......
......@@ -17,18 +17,18 @@ DEPEND_COMPILE += \
SKIP_NORETURN=1 #Do not add the -Wmissing-noreturn flag
HERE = db-benchmark-test
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
BENCHDBS = bench.bdb/ bench.tokudb ptest*.dir/ x.dir/ xfast.dir/
ifdef BDBDIR
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include -I$(PORTABILITY_HEADERS)
BDB_CPPFLAGS = -D_GNU_SOURCE -I$(BDBDIR)/include -I../include
BDB_LDFLAGS = -L$(BDBDIR)/lib -ldb -Wl,-rpath,$(BDBDIR)/lib $(LIBPORTABILITY) -lpthread
else
BDB_CPPFLAGS = -I$(PORTABILITY_HEADERS) -I../include
BDB_CPPFLAGS =
BDB_LDFLAGS = -ldb $(LIBPORTABILITY)
endif
BDB_CPPFLAGS += -D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
BDB_CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600 -DBDB -I$(TOKUROOT)toku_include -I$(PORTABILITY_HEADERS)
TOKUDB=libtokudb.$(SOEXT)
TDB_DLINK_FILES = $(TOKUROOT)lib/$(TOKUDB)
......@@ -62,7 +62,7 @@ clean:
rm -f $(TARGETS)
rm -rf $(BENCHDBS)
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS += -DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I../include
$(TARGET_TDB) $(SCANSCAN_TDB): BIN_FROM_C_FLAGS+=-DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include -I$(TOKUROOT)include
ifneq ($(PROF),)
USE_STATIC=1
......
......@@ -2,6 +2,10 @@
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
/* Insert a bunch of stuff */
#ifdef BDB
typedef unsigned int u_int;
#endif
#include <db.h>
#include <toku_portability.h>
#include <assert.h>
#include <errno.h>
......@@ -10,7 +14,6 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <db.h>
#if !defined(DB_YESOVERWRITE)
#define DB_YESOVERWRITE 0
......
......@@ -2,8 +2,7 @@
.DEFAULT_GOAL=install
TOKUROOT=../
INCLUDEDIRS=-I$(TOKUROOT)include/linux
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
......
......@@ -16,7 +16,7 @@ NEWBRT_BUNDLE = newbrt.bundle
LINK_FILES += $(NEWBRT)
SKIP_NEWBRTRULE=1
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
......@@ -65,7 +65,7 @@ BRT_C_FILES = $(patsubst %,%.c,$(BRT_SOURCES))
BRT_O_FILES = $(patsubst %,%.$(OEXT),$(BRT_SOURCES))
newbrt.$(OEXT): $(BRT_C_FILES) $(DEPEND_COMPILE)
$(CC) $(BRT_C_FILES) $(COMBINE_C) $(O_FROM_C_FLAGS)
$(CC) -c $(BRT_C_FILES) $(COMBINE_C) $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
ifneq ($(CYGWIN),)
......
NEWBRT_REGRESSION_TESTS = \
brt-serialize-test \
brt-test \
brt-test-cursor \
brt-test-cursor-2 \
brt-test-named-db \
brt-test0 \
brt-test1 \
brt-test2 \
brt-test3 \
brt-test4 \
brt-test5 \
cachetable-test \
cachetable-test2 \
fifo-test \
list-test \
log-test \
log-test2 \
log-test3 \
log-test4 \
log-test5 \
log-test6 \
omt-test \
test-assert \
test-brt-delete-both \
test-brt-overflow \
test-del-inorder \
test-inc-split \
test-primes \
test_oexcl \
test_toku_malloc_plain_free \
ybt-test \
# This line intentially kept commented so I can have a \ on the end of the previous line
NEWBRT_BINS = $(NEWBRT_REGRESSION_TESTS) \
benchmark-test \
brtdump \
tdb_logprint \
# This line intentially kept commented so I can have a \ on the end of the previous line
NEWBRT_HERE = $(ROOT)newbrt
NEWBRT_RBINS = $(patsubst %,$(NEWBRT_HERE)/%,$(NEWBRT_BINS))
BINS += $(NEWBRT_RBINS)
# Must include crc first
NEWBRT_FILES = \
crc \
brt-serialize \
brt-verify \
brt \
cachetable \
fifo \
fingerprint \
key \
leafentry \
log \
log_code \
memory \
mempool \
omt \
primes \
recover \
roll \
toku_assert \
ybt \
# keep this line so I can have a \ on the previous line
OFILES += $(NEWBRT_HERE)/newbrt.o
$(NEWBRT_HERE)/newbrt.o: CPPFLAGS += -I$(NEWBRT_HERE)
$(NEWBRT_HERE)/newbrt.o: $(patsubst %,$(NEWBRT_HERE)/%.c,$(NEWBRT_FILES))
cd $(NEWBRT_HERE);$(CC) -combine $(CFLAGS) $(CPPFLAGS) $(patsubst %,%.c,$(NEWBRT_FILES)) -c -o $@
$(NEWBRT_RBINS): $(NEWBRT_HERE)/newbrt.o
NEWBRT_NEED_HELPERS = test-inc-split test-del-inorder
$(patsubst %,$(NEWBRT_HERE)/%, $(NEWBRT_NEED_HELPERS)): $(NEWBRT_HERE)/brt-test-helpers.o
# Put the benchmarktest_256 first since it takes a long time (and we want to use parallelism in the make)
NEWBRT_CHECKS = \
benchmarktest_256 \
$(NEWBRT_REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the previous line
newbrt.checkdir: $(patsubst %,$(NEWBRT_HERE)/%.check, $(NEWBRT_CHECKS))
newbrt.builddir: $(OFILES) $(NEWBRT_RBINS)
$(NEWBRT_HERE)/benchmarktest_256.check: $(NEWBRT_HERE)/benchmark-test
cd $(NEWBRT_HERE); $(VGRIND) ./benchmark-test $(VERBVERBOSE) --valsize 256 --verify 1
#foo:
# echo $(NEWBRT_HERE)/benchmarktest_256.check
$(NEWBRT_HERE)/test-assert.check: $(NEWBRT_HERE)/test-assert
@# no arguments, should err
cd $(NEWBRT_HERE); $(VGRIND) ./test-assert > /dev/null 2>&1 ; test \($$?\)
@# one argument, not "ok" should err
@echo Expect an abort message:
$(NEWBRT_HERE); ($(VGRIND) ./test-assert notok) > test-assert.out 2>&1 ; test \($$?\)
@fgrep failed test-assert.out > /dev/null
@rm test-assert.out
@# one argument, "ok" should not error
$(NEWBRT_HERE)/ $(VGRIND) ./test-assert ok
.DEFAULT_GOAL=build
TOKUROOT=../../
INCLUDEDIRS=-I. -I..
include $(TOKUROOT)include/Makefile.include
CPPFLAGS += -D_GNU_SOURCE
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
......
#include "toku_portability.h"
#include "../include/rdtsc.h"
#include "rdtsc.h"
#include "trace_mem.h"
// customize this as required
......
......@@ -11,8 +11,8 @@ DEPEND_COMPILE += \
$(TOKUROOT)newbrt/log.c \
#End of line
ydbtrace.o tdbtrace.o: tdbtrace.h
include $(TOKUROOT)include/Makefile.include
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE
YDB=ydb.$(AEXT)
TYDB=tydb.$(AEXT)
......@@ -68,6 +68,7 @@ libs: $(LIBRARIES) ;
buildlocktrees: $(LOCKTREE) $(RANGETREE) ;
$(OBJS) $(TOBJS): CPPFLAGS+=-I$(TOKUROOT)include
$(YDB): $(OBJS)
$(TYDB): $(TOBJS)
......@@ -122,6 +123,7 @@ clean:
cd lock_tree && $(MAKE) clean
cd range_tree && $(MAKE) clean
ydbtrace.$(OEXT): CPPFLAGS+=-DTOKUTRACE
ydbtrace.$(OEXT): ydb.c $(DEPEND_COMPILE)
$(CC) $< $(O_FROM_C_FLAGS) -DTOKUTRACE
$(CC) -c $< $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
SRC_HERE = $(ROOT)src
include $(ROOT)src/lock_tree/Makefile.include
include $(ROOT)src/range_tree/Makefile.include
include $(ROOT)src/tests/Makefile.include
OFILES += $(SRC_HERE)/lock_and_range_tree.o
$(SRC_HERE)/lock_and_range_tree.o: CPPFLAGS += -I$(LOCKTREE_HERE) -I$(LOCKTREE_HERE)/.. -I$(LOCKTREE_HERE)/../range_tree -I$(LOCKTREE_HERE)/../../include -I$(LOCKTREE_HERE)/../../newbrt
$(SRC_HERE)/lock_and_range_tree.o: $(patsubst %,$(LOCKTREE_HERE)/%.c,$(LOCKTREE_FILES)) $(patsubst %,$(RANGETREE_HERE)/%.c,$(RANGETREE_FILES))
$(CC) -combine $(CFLAGS) $(CPPFLAGS) $^ -c -o $@
SRC_FILES = ydb errors elocks lock_and_range_tree
SRC_OFILES = $(patsubst %, $(SRC_HERE)/%.o, $(SRC_FILES)) $(ROOT)newbrt/newbrt.o
LIBS += $(ROOT)lib/libtokudb.so $(ROOT)lib/libtokudb.a
$(ROOT)src/%.o: CPPFLAGS += -I$(ROOT)include -I$(ROOT)newbrt -I$(ROOT)src/lock_tree -I$(ROOT)src/range_tree
$(ROOT)lib/libtokudb.a: $(SRC_OFILES)
$(AR) rv $@ $^
$(ROOT)lib/libtokudb.$(LIBEXT): $(SRC_OFILES)
cc $^ $(SHARED) -o $@ $(CFLAGS) $(RPATHNAME)
......@@ -9,7 +9,7 @@ DEPEND_COMPILE+= \
#end
SKIP_LOCKTREERULE=1
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
LOCKTREE = locktree.$(AEXT)
LOCKTREE_LINEAR = locktree_linear.$(AEXT)
......@@ -28,15 +28,17 @@ LIBRARIES=$(LOCKTREE_LINEAR) $(LOCKTREE_TLOG) $(LOCKTREE) # $(LOCKTREE_LOG)
$(LOCKTREE_TLOG): $(OBJS) locktree_nooverlap.$(OEXT)
$(LOCKTREE_LOG) $(LOCKTREE_LINEAR): $(OBJS) locktree.$(OEXT)
locktree.$(OEXT) locktree_nooverlap.$(OEXT) $(OBJS): CPPFLAGS+=-I$(TOKUROOT)include
$(LOCKTREE): $(LOCKTREE_TLOG)
cp $< $@
.PHONY: build check
build: $(LIBRARIES)
locktree_nooverlap.$(OEXT): CPPFLAGS+=-DTOKU_RT_NOOVERLAPS
locktree_nooverlap.$(OEXT): locktree.c $(DEPEND_COMPILE)
$(CC) $< -DTOKU_RT_NOOVERLAPS $(O_FROM_C_FLAGS)
$(CC) $< -c $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
build check clean:
cd tests;$(MAKE) $@
......@@ -10,7 +10,7 @@ DEPEND_COMPILE += \
DEPEND_COMPILE+= $(NEWBRT)
LINK_FILES=$(NEWBRT)
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
......
......@@ -9,7 +9,7 @@ DEPEND_COMPILE+= \
SKIP_RANGETREERULE=1
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
RANGETREE = rangetree.$(AEXT)
RANGETREE_LINEAR = rangetree_linear.$(AEXT)
......@@ -27,6 +27,8 @@ $(RANGETREE_TLOG): log_nooverlap.$(OEXT)
$(RANGETREE_LINEAR): linear.$(OEXT)
$(RANGETREE_LOG): log.$(OEXT)
$(RANGETREE_TLOG) $(RANGETREE_LINEAR) $(RANGETREE_LOG): CPPFLAGS+=-I$(TOKUROOT)include
$(RANGETREE): $(RANGETREE_TLOG)
cp $< $@
......
......@@ -8,7 +8,7 @@ NEWBRT=$(TOKUROOT)newbrt/newbrt.$(AEXT)
DEPEND_COMPILE+=$(NEWBRT)
LINK_FILES=$(NEWBRT)
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
......@@ -21,6 +21,7 @@ TLOG_TESTS = $(patsubst %.c,%.tlog$(BINSUF),$(SRCS))
LIN_TESTS = $(patsubst %.c,%.lin$(BINSUF),$(SRCS))
ALL_TESTS = $(LIN_TESTS) $(TLOG_TESTS) #$(LOG_TESTS)
$(ALL_TESTS): CPPFLAGS+=-I$(TOKUROOT)include
RUN_LOG_TESTS = $(patsubst %.log$(BINSUF),%.logrun,$(LOG_TESTS))
RUN_TLOG_TESTS = $(patsubst %.tlog$(BINSUF),%.tlogrun,$(TLOG_TESTS))
......
......@@ -17,7 +17,7 @@ static void
setup_tree (BOOL allow_overlaps, BOOL insert, int left, int right, int data) {
int r;
toku_range range;
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, toku_malloc, toku_free, toku_realloc);
CKERR(r);
if (insert) {
......
......@@ -82,7 +82,7 @@ fail_malloc (size_t size) {
errno = ENOMEM;
return NULL;
}
return malloc(size);
return toku_malloc(size);
}
static inline void
......
......@@ -14,7 +14,7 @@ int main(int argc, const char *argv[]) {
#ifdef TOKU_RT_NOOVERLAPS
if (allow_overlaps) continue;
#endif
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree!=NULL);
......@@ -37,7 +37,7 @@ int main(int argc, const char *argv[]) {
mallocced = 0;
failon = i;
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps,
fail_malloc, free, realloc);
fail_malloc, toku_free, toku_realloc);
CKERR2(r, ENOMEM);
assert(tree==NULL);
......
......@@ -10,24 +10,24 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv);
/* Create tests */
r = toku_rt_create(NULL, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(NULL, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, NULL, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, NULL, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR2(r, EINVAL);
assert(tree == NULL);
r = toku_rt_create(&tree, int_cmp, NULL, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, NULL, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, NULL, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, NULL, toku_free, toku_realloc);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, NULL, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, NULL, toku_realloc);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, NULL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, NULL);
CKERR2(r, EINVAL);
assert(tree == NULL);
......@@ -40,7 +40,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_insert(NULL, &range);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -53,7 +53,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_delete(NULL, &range);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -70,7 +70,7 @@ int main(int argc, const char *argv[]) {
range.ends.right = (toku_point*)&stuff[1];
range.data = 0;
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -100,7 +100,7 @@ int main(int argc, const char *argv[]) {
/* Predecessor tests */
toku_point* foo = (toku_point*)&stuff[0];
BOOL wasfound;
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -119,7 +119,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r);
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, TRUE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, TRUE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -133,7 +133,7 @@ int main(int argc, const char *argv[]) {
/* Successor tests */
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -152,7 +152,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r);
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, TRUE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, TRUE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......@@ -169,7 +169,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_get_allow_overlaps(NULL, &allowed);
CKERR2(r, EINVAL);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, TXNID_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
assert(tree != NULL);
......
......@@ -21,7 +21,7 @@ int main(int argc, const char *argv[]) {
|-------B-------|
*/
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
/* Verify we can insert a trivial range and lose it. */
......@@ -112,7 +112,7 @@ int main(int argc, const char *argv[]) {
|---A---|
|---B---|
*/
r = toku_rt_create(&tree, int_cmp, char_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
/* Verify we can insert a trivial range and lose it. */
......
......@@ -12,7 +12,7 @@ static void* malloc_fail(size_t size) {
errno = ENOMEM;
return NULL;
} else
return malloc(size);
return toku_malloc(size);
}
static void
......@@ -30,7 +30,7 @@ RunTest (BOOL f_overlaps_allowed) {
/* Insert and delete lots of ranges to force memory increase and decrease */
r = toku_rt_create(&tree, int_cmp, char_cmp, f_overlaps_allowed, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, f_overlaps_allowed, toku_malloc, toku_free, toku_realloc);
CKERR(r);
/* Insert lots of ranges */
......@@ -61,8 +61,8 @@ RunTest (BOOL f_overlaps_allowed) {
/* Failure when allocating the tree */
malloc_cnt = 0;
malloc_cntl = 1;
r = toku_rt_create(&tree, int_cmp, char_cmp, f_overlaps_allowed, malloc_fail, free,
realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, f_overlaps_allowed, malloc_fail, toku_free,
toku_realloc);
CKERR2(r, ENOMEM);
}
......
......@@ -22,9 +22,9 @@ run_test (BOOL overlap_allowed) {
int_cmp,
char_cmp,
overlap_allowed,
malloc,
free,
realloc
toku_malloc,
toku_free,
toku_realloc
);
CKERR(r);
......
......@@ -40,7 +40,7 @@ int main(int argc, const char *argv[]) {
|-------A-------|
|-------B-------|
*/
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
r = toku_rt_find(tree, &find_range, 4, &buf, &bufsize, &found); CKERR(r);
......@@ -172,7 +172,7 @@ int main(int argc, const char *argv[]) {
/* Done */
r = toku_rt_close(tree); CKERR(r);
free(buf);
toku_free(buf);
buf = NULL;
#endif /* #ifdef TOKU_RT_NOOVERLAPS */
......@@ -190,7 +190,7 @@ int main(int argc, const char *argv[]) {
find_range.left = (toku_point*)&nums[3];
find_range.right = (toku_point*)&nums[4];
r = toku_rt_create(&tree, int_cmp, char_cmp, FALSE, malloc, free, realloc);
r = toku_rt_create(&tree, int_cmp, char_cmp, FALSE, toku_malloc, toku_free, toku_realloc);
CKERR(r);
r = toku_rt_find(tree, &find_range, 4, &buf, &bufsize, &found); CKERR(r);
......
......@@ -10,8 +10,8 @@ DEPEND_COMPILE += \
test.h \
#end
SKIP_NORETURN=1 #Do not add the -Wmissing-noreturn flag
include $(TOKUROOT)include/Makefile.include
CPPFLAGS += -D_GNU_SOURCE
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
LIBTDB=../libtokudb.$(SOEXT)
TLIBTDB=../libtokudbtrace.$(SOEXT)
......@@ -165,6 +165,7 @@ endif
%.tdbt$(BINSUF): DLINK_FILES+=$(TLIBTDB)
%.tdbt$(BINSUF): RPATH_DIRS+=$(dir $(TLIBTDB))
%.tdb$(BINSUF) %.tdbt$(BINSUF): CFLAGS+= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(filter-out ../../lib/libtokuportability.a,$(BIN_FROM_C_FLAGS))
......
......@@ -72,6 +72,8 @@ test1 (void)
r = db_env_set_func_realloc(brealloc); assert(r==0);
r = db_env_set_func_free(bfree); assert(r==0);
#ifdef USE_TDB
// toku_malloc isn't affected by calling the BDB set_fun_malloc calls.
malloc_counter = realloc_counter = free_counter = 0;
{
......@@ -80,7 +82,6 @@ test1 (void)
toku_free(x); assert(malloc_counter==1 && free_counter==1 && realloc_counter==1);
}
#ifdef USE_TDB
r = db_env_set_func_malloc(dlmalloc); assert(r==0);
r = db_env_set_func_realloc(dlrealloc); assert(r==0);
r = db_env_set_func_free(dlfree); assert(r==0);
......
......@@ -69,7 +69,7 @@ else ifeq ($(VERBOSE),1)
MAYBEATSIGN=@
endif
CPPFLAGS = $(INCLUDEDIRS) -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)include
CPPFLAGS = $(INCLUDEDIRS) -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include
#CFLAG default options
# Add -Wconversion #DISABLED for now.
......@@ -111,9 +111,9 @@ OPT_ARFLAGS=cr
LINK=-l
DEPEND_COMPILE += \
$(TOKUROOT)include/db.h \
$(TOKUROOT)include/toku_os.h \
$(TOKUROOT)include/toku_portability.h \
$(TOKUROOT)include/rdtsc.h \
$(TOKUROOT)toku_include/toku_os.h \
$(TOKUROOT)toku_include/toku_portability.h \
$(TOKUROOT)toku_include/rdtsc.h \
# keep this line so I can have a \ on the previous line
CCQUIET=
......@@ -260,7 +260,7 @@ LDFLAGS += -$(CRUNTIME)
CFLAGS += -$(CRUNTIME)
endif
# Need XOPEN_SOURCE=600 to get strtoll()
CPPFLAGS += -D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
#TODO: Fix this up if we want to keep using CIL.
#ifeq ($(CIL),1)
......@@ -359,9 +359,8 @@ BIN_FROM_O_FLAGS_NOLIB=$(CFLAGS) $(CPPFLAGS) $(BINOUTPUT)$@ $(LDFLAGS_NOLIB)
%$(BINSUF):%.$(OEXT) $(DEPEND_COMPILE) $(DEPEND_LINK)
$(CC) $< $(BIN_FROM_O_FLAGS)
O_FROM_C_FLAGS= $(CFLAGS) $(CPPFLAGS) -c $(OOUTPUT)$@
%.$(OEXT):%.c $(DEPEND_COMPILE)
$(CC) $< $(O_FROM_C_FLAGS)
$(CC) $< -c $(CPPFLAGS) $(CFLAGS) $(OOUTPUT)$@
%.$(AEXT):
$(AR) $(ARFLAGS) $(AROUTPUT)$@ $(filter %.$(OEXT),$^) $(patsubst %.bundle, %.bundle/*.$(OEXT), $(filter-out %.$(OEXT),$^))
......
......@@ -10,7 +10,7 @@ DEPEND_COMPILE += \
#end
HERE = utils
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
ifndef BDBDIR
BDBDIR=/usr/local/BerkeleyDB.4.4
endif
......
......@@ -4,7 +4,7 @@
TOKUROOT=../
INCLUDEDIRS=-I.
SKIP_LIBPORTABILITYRULE=1
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
OPT_AROPT=-qnoipo #Disable ipo for lib creation even when optimization is on.
......
......@@ -3,7 +3,7 @@
.DEFAULT_GOAL=all
TOKUROOT=../../
INCLUDEDIRS=-I$(TOKUROOT)include/windows -I$(TOKUROOT)newbrt
include $(TOKUROOT)include/Makefile.include
include $(TOKUROOT)toku_include/Makefile.include
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
......
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