Skip to content

Commit

Permalink
dashbls: replace flaky minialloc with microsoft/mimalloc@91ba1f37, ad…
Browse files Browse the repository at this point in the history
…d as vendored dependency (dashpay#55)

* build: drop minialloc from build system

* depends: drop minialloc from source tree

* Squashed 'depends/mimalloc/' content from commit 91ba1f374

git-subtree-dir: depends/mimalloc
git-subtree-split: 91ba1f374da66e624841f53f6659da3a8f8f93ea

* build: add mimalloc to build system, set as default (de)allocator
  • Loading branch information
kwvg committed Dec 21, 2022
1 parent 85b7e61 commit 8383f08
Show file tree
Hide file tree
Showing 294 changed files with 61,976 additions and 1,040 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,15 @@ set(QUIET "on" CACHE STRING "Relic - Build with printing disabled")
set(PP_EXT "LAZYR" CACHE STRING "")
set(PP_METHD "LAZYR;OATEP" CACHE STRING "")

# Disable mimalloc shared libraries and tests, enable secure mode
set(MI_SECURE "on" CACHE STRING "")

set(MI_BUILD_SHARED "off" CACHE STRING "")
set(MI_BUILD_TESTS "off" CACHE STRING "")
set(MI_OVERRIDE "off" CACHE STRING "")

add_subdirectory(depends/relic)
add_subdirectory(depends/minialloc)
add_subdirectory(depends/mimalloc)

add_subdirectory(src)

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CLEANFILES =

include Makefile.bls.include

CLEANFILES += $(LIBRELIC) $(LIBDASHBLS) $(LIBMINIALLOC)
CLEANFILES += $(LIBRELIC) $(LIBDASHBLS) $(LIBMIMALLOC)

if USE_TESTS
CLEANFILES += $(DASHBLS_RUNTEST)
Expand Down
10 changes: 5 additions & 5 deletions Makefile.bls.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

LIBDASHBLS = libdashbls.la

DASHBLS_CPPFLAGS = -DBLSALLOC_MINIALLOC=1
DASHBLS_CPPFLAGS = -DBLSALLOC_MIMALLOC=1

DASHBLS_INCLUDES = \
-I$(builddir) \
Expand Down Expand Up @@ -40,19 +40,19 @@ libdashbls_la_SOURCES = \

libdashbls_la_SOURCES += \
$(DASHBLS_H) \
$(MINIALLOC_H) \
$(MIMALLOC_H) \
$(RELIC_H)

libdashbls_la_LIBADD = \
$(LIBMINIALLOC) \
$(LIBMIMALLOC) \
$(LIBRELIC) \
$(GMP_LIBS)

libdashbls_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELIC_INCLUDES) $(MINIALLOC_INCLUDES) $(DASHBLS_INCLUDES) $(DASHBLS_CPPFLAGS)
libdashbls_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELIC_INCLUDES) $(MIMALLOC_INCLUDES) $(DASHBLS_INCLUDES) $(DASHBLS_CPPFLAGS)
libdashbls_la_CXXFLAGS = $(AM_CXXFLAGS)
libdashbls_la_LDFLAGS = $(AM_LDFLAGS)

include Makefile.minialloc.include
include Makefile.mimalloc.include
include Makefile.relic.include

if USE_TESTS
Expand Down
44 changes: 44 additions & 0 deletions Makefile.mimalloc.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2022 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING.MIT or http://www.opensource.org/licenses/mit-license.php.

LIBMIMALLOC = libmimalloc-secure.la

MIMALLOC_CFLAGS = \
-DMI_SECURE=4 \
-DNDEBUG

MIMALLOC_INCLUDES = \
-I$(top_srcdir)/depends/mimalloc/include \
-I$(top_srcdir)/depends/mimalloc/src

MIMALLOC_H = \
depends/mimalloc/include/mimalloc.h \
depends/mimalloc/include/mimalloc-atomic.h \
depends/mimalloc/include/mimalloc-internal.h \
depends/mimalloc/include/mimalloc-new-delete.h \
depends/mimalloc/include/mimalloc-override.h \
depends/mimalloc/include/mimalloc-track.h \
depends/mimalloc/include/mimalloc-types.h \
depends/mimalloc/src/bitmap.h

libmimalloc_secure_la_SOURCES = \
$(MIMALLOC_H) \
depends/mimalloc/src/stats.c \
depends/mimalloc/src/random.c \
depends/mimalloc/src/os.c \
depends/mimalloc/src/bitmap.c \
depends/mimalloc/src/arena.c \
depends/mimalloc/src/segment-cache.c \
depends/mimalloc/src/segment.c \
depends/mimalloc/src/page.c \
depends/mimalloc/src/alloc.c \
depends/mimalloc/src/alloc-aligned.c \
depends/mimalloc/src/alloc-posix.c \
depends/mimalloc/src/heap.c \
depends/mimalloc/src/options.c \
depends/mimalloc/src/init.c

libmimalloc_secure_la_CFLAGS = $(AM_CFLAGS) $(MIMALLOC_INCLUDES) $(MIMALLOC_CFLAGS)

noinst_LTLIBRARIES += $(LIBMIMALLOC)
30 changes: 0 additions & 30 deletions Makefile.minialloc.include

This file was deleted.

12 changes: 12 additions & 0 deletions depends/mimalloc/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# default behavior is to always use unix style line endings
* text eol=lf
*.png binary
*.pdn binary
*.jpg binary
*.sln binary
*.suo binary
*.vcproj binary
*.patch binary
*.dll binary
*.lib binary
*.exe binary
9 changes: 9 additions & 0 deletions depends/mimalloc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ide/vs20??/*.db
ide/vs20??/*.opendb
ide/vs20??/*.user
ide/vs20??/*.vcxproj.filters
ide/vs20??/.vs
ide/vs20??/VTune*
out/
docs/
*.zip
Loading

0 comments on commit 8383f08

Please sign in to comment.