Skip to content

Commit

Permalink
Auto merge of rust-lang#30434 - alexcrichton:update-jemalloc, r=alexc…
Browse files Browse the repository at this point in the history
…richton

It's been awhile since we last updated jemalloc, and there's likely some bugs
that have been fixed since the last version we're using, so let's try to update
again.
  • Loading branch information
bors committed Dec 21, 2015
2 parents 2343a92 + 9929c24 commit 5d4efcb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 18 additions & 5 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,25 @@ define DEF_THIRD_PARTY_TARGETS

# $(1) is the target triple

ifeq ($$(CFG_WINDOWSY_$(1)), 1)
# This isn't necessarily a desired option, but it's harmless and works around
# what appears to be a mingw-w64 bug.
ifeq ($$(CFG_WINDOWSY_$(1)),1)
# A bit of history here, this used to be --enable-lazy-lock added in #14006
# which was filed with jemalloc in jemalloc/jemalloc#83 which was also
# reported to MinGW: http://sourceforge.net/p/mingw-w64/bugs/395/
#
# When updating jemalloc to 4.0, however, it was found that binaries would
# exit with the status code STATUS_RESOURCE_NOT_OWNED indicating that a thread
# was unlocking a mutex it never locked. Disabling this "lazy lock" option
# seems to fix the issue, but it was enabled by default for MinGW targets in
# 13473c7 for jemalloc.
#
# As a result of all that, force disabling lazy lock on Windows, and after
# reading some code it at least *appears* that the initialization of mutexes
# is otherwise ok in jemalloc, so shouldn't cause problems hopefully...
#
# https://sourceforge.net/p/mingw-w64/bugs/395/
JEMALLOC_ARGS_$(1) := --enable-lazy-lock
# tl;dr: make windows behave like other platforms by disabling lazy locking,
# but requires passing an option due to a historical default with
# jemalloc.
JEMALLOC_ARGS_$(1) := --disable-lazy-lock
else ifeq ($(OSTYPE_$(1)), apple-ios)
JEMALLOC_ARGS_$(1) := --disable-tls
else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
Expand Down
2 changes: 1 addition & 1 deletion src/jemalloc
Submodule jemalloc updated 102 files

0 comments on commit 5d4efcb

Please sign in to comment.