BUILD: Makefile: remove outdated support for dlmalloc

dlmalloc has remained unused for quite a while now, in part because it
is not thread-safe and in part because it has been superseded by the
much better and faster jemalloc. So let's simplify the makefile and
remove entries related to this library.
This commit is contained in:
Willy Tarreau 2019-03-27 14:20:43 +01:00
parent 9fc5cc609d
commit c3643517f3
2 changed files with 3 additions and 31 deletions

10
INSTALL
View File

@ -146,13 +146,9 @@ Optional dependencies may be split into several categories :
4.1) Memory allocation 4.1) Memory allocation
---------------------- ----------------------
By default, HAProxy uses the standard malloc() call provided by the libc. It By default, HAProxy uses the standard malloc() call provided by the libc. It
may be built to use dlmalloc instead. In this case, "USE_DLMALLOC=1" needs to may also be built to use jemalloc, which is fast and thread-safe. In order to
be appended to the build options, and "DLMALLOC_SRC" needs to point to the use it, please add "-ljemalloc" to the ADDLIB variable. You may possibly also
absolute path to "dlmalloc.c". Doing this is not safe when using threads. need to append "-lpthread" and/or "-ldl" depending on the operating system.
HAProxy may also be built to use jemalloc, which is fast and thread-safe.
In order to use it, please add "-ljemalloc" to the ADDLIB variable. You may
possibly also need to append "-lpthread" and/or "-ldl" depending on the
operating system.
4.2) Regular expressions 4.2) Regular expressions

View File

@ -8,7 +8,6 @@
# #
# Valid USE_* options are the following. Most of them are automatically set by # Valid USE_* options are the following. Most of them are automatically set by
# the TARGET, others have to be explicitly specified : # the TARGET, others have to be explicitly specified :
# USE_DLMALLOC : enable use of dlmalloc (see DLMALLOC_SRC)
# USE_EPOLL : enable epoll() on Linux 2.6. Automatic. # USE_EPOLL : enable epoll() on Linux 2.6. Automatic.
# USE_KQUEUE : enable kqueue() on BSD. Automatic. # USE_KQUEUE : enable kqueue() on BSD. Automatic.
# USE_MY_EPOLL : redefine epoll_* syscalls. Automatic. # USE_MY_EPOLL : redefine epoll_* syscalls. Automatic.
@ -80,8 +79,6 @@
# installation only. # installation only.
# #
# Other variables : # Other variables :
# DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c.
# DLMALLOC_THRES : should match PAGE_SIZE on every platform (default: 4096).
# PCRE_CONFIG : force the binary path to get pcre config (by default # PCRE_CONFIG : force the binary path to get pcre config (by default
# pcre-config) # pcre-config)
# PCREDIR : force the path to libpcre. # PCREDIR : force the path to libpcre.
@ -606,24 +603,6 @@ BUILD_OPTIONS += $(call ignore_implicit,USE_RT)
OPTIONS_LDFLAGS += -lrt OPTIONS_LDFLAGS += -lrt
endif endif
# report DLMALLOC_SRC only if explicitly specified
ifneq ($(DLMALLOC_SRC),)
BUILD_OPTIONS += DLMALLOC_SRC=$(DLMALLOC_SRC)
endif
ifneq ($(USE_DLMALLOC),)
BUILD_OPTIONS += $(call ignore_implicit,USE_DLMALLOC)
ifeq ($(DLMALLOC_SRC),)
DLMALLOC_SRC=src/dlmalloc.c
endif
endif
ifneq ($(DLMALLOC_SRC),)
# DLMALLOC_THRES may be changed to match PAGE_SIZE on every platform
DLMALLOC_THRES = 4096
OPTIONS_OBJS += src/dlmalloc.o
endif
ifneq ($(USE_OPENSSL),) ifneq ($(USE_OPENSSL),)
# OpenSSL is packaged in various forms and with various dependencies. # OpenSSL is packaged in various forms and with various dependencies.
# In general -lssl is enough, but on some platforms, -lcrypto may be needed, # In general -lssl is enough, but on some platforms, -lcrypto may be needed,
@ -969,9 +948,6 @@ src/haproxy.o: src/haproxy.c $(DEP)
-DBUILD_OPTIONS='"$(strip $(BUILD_OPTIONS))"' \ -DBUILD_OPTIONS='"$(strip $(BUILD_OPTIONS))"' \
-c -o $@ $< -c -o $@ $<
src/dlmalloc.o: $(DLMALLOC_SRC) $(DEP)
$(cmd_CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<
install-man: install-man:
$(Q)install -v -d "$(DESTDIR)$(MANDIR)"/man1 $(Q)install -v -d "$(DESTDIR)$(MANDIR)"/man1
$(Q)install -v -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1 $(Q)install -v -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1