Merge branch 'dev' into dev-slice

This commit is contained in:
Daan Leijen 2020-12-17 14:11:50 -08:00
commit da79629308
16 changed files with 38 additions and 8 deletions

1
.gitattributes vendored
View file

@ -2,6 +2,7 @@
* text eol=lf * text eol=lf
*.png binary *.png binary
*.pdn binary *.pdn binary
*.jpg binary
*.sln binary *.sln binary
*.suo binary *.suo binary
*.vcproj binary *.vcproj binary

View file

@ -186,8 +186,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM
endif() endif()
# Architecture flags # Architecture flags
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm") if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm" AND NOT APPLE)
list(APPEND mi_cflags -march=native) check_cxx_compiler_flag(-march=native CXX_SUPPORTS_MARCH_NATIVE)
if (CXX_SUPPORTS_MARCH_NATIVE)
list(APPEND mi_cflags -march=native)
endif()
endif() endif()
# extra needed libraries # extra needed libraries

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='167.731pt' version='1.1' viewBox='52.938 54.996 381.624 167.731' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='167.731pt' version='1.1' viewBox='52.938 54.996 381.624 167.731' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip1'> <clipPath id='clip1'>
<path d='M82.148 206.586H434.164V81.34H82.148Z'/> <path d='M82.148 206.586H434.164V81.34H82.148Z'/>

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='258.383pt' version='1.1' viewBox='106.736 54.996 381.623 258.383' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='258.383pt' version='1.1' viewBox='106.736 54.996 381.623 258.383' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip2'> <clipPath id='clip2'>
<path d='M135.949 251.93H487.961V84.164H135.949Z'/> <path d='M135.949 251.93H487.961V84.164H135.949Z'/>

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='193.064pt' version='1.1' viewBox='52.938 51.67 381.624 193.064' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='193.064pt' version='1.1' viewBox='52.938 51.67 381.624 193.064' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip7'> <clipPath id='clip7'>
<path d='M82.148 228.594H434.164V60.828H82.148Z'/> <path d='M82.148 228.594H434.164V60.828H82.148Z'/>

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='255.738pt' version='1.1' viewBox='106.736 54.996 381.624 255.738' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='255.738pt' version='1.1' viewBox='106.736 54.996 381.624 255.738' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip8'> <clipPath id='clip8'>
<path d='M135.949 249.281H487.961V81.519H135.949Z'/> <path d='M135.949 249.281H487.961V81.519H135.949Z'/>

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='164.687pt' version='1.1' viewBox='52.938 54.996 381.625 164.687' width='381.625pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='164.687pt' version='1.1' viewBox='52.938 54.996 381.625 164.687' width='381.625pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip1'> <clipPath id='clip1'>
<path d='M82.148 203.937H434.164V78.691H82.148Z'/> <path d='M82.148 203.937H434.164V78.691H82.148Z'/>

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='165.084pt' version='1.1' viewBox='52.938 54.996 381.624 165.084' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='165.084pt' version='1.1' viewBox='52.938 54.996 381.624 165.084' width='381.624pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip5'> <clipPath id='clip5'>
<path d='M82.148 203.937H434.164V78.691H82.148Z'/> <path d='M82.148 203.937H434.164V78.691H82.148Z'/>

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='258.383pt' version='1.1' viewBox='106.736 54.996 381.623 258.383' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='258.383pt' version='1.1' viewBox='106.736 54.996 381.623 258.383' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip6'> <clipPath id='clip6'>
<path d='M135.949 251.93H487.961V84.164H135.949Z'/> <path d='M135.949 251.93H487.961V84.164H135.949Z'/>

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='243.704pt' version='1.1' viewBox='106.737 54.995 381.623 243.704' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='243.704pt' version='1.1' viewBox='106.737 54.995 381.623 243.704' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip2'> <clipPath id='clip2'>
<path d='M135.949 249.281H487.961V81.515H135.949Z'/> <path d='M135.949 249.281H487.961V81.515H135.949Z'/>

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='164.687pt' version='1.1' viewBox='52.938 54.996 381.625 164.687' width='381.625pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='164.687pt' version='1.1' viewBox='52.938 54.996 381.625 164.687' width='381.625pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip7'> <clipPath id='clip7'>
<path d='M82.148 203.937H434.164V78.691H82.148Z'/> <path d='M82.148 203.937H434.164V78.691H82.148Z'/>

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View file

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.4.2 --> <!-- This file was generated by dvisvgm 2.4.2 -->
<svg height='196.567pt' version='1.1' viewBox='106.737 54.996 381.623 196.567' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> <svg height='196.567pt' version='1.1' viewBox='106.737 54.996 381.623 196.567' width='381.623pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<rect width="1000%" height="1000%" fill="white"/>
<defs> <defs>
<clipPath id='clip8'> <clipPath id='clip8'>
<path d='M135.949 203.938H487.961V78.692H135.949Z'/> <path d='M135.949 203.938H487.961V78.692H135.949Z'/>

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

BIN
doc/ds-logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View file

@ -282,16 +282,22 @@ static inline void mi_atomic_yield(void) {
YieldProcessor(); YieldProcessor();
} }
#elif (defined(__GNUC__) || defined(__clang__)) && \ #elif (defined(__GNUC__) || defined(__clang__)) && \
(defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)) (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH__ >= 7) || defined(__aarch64__))
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ volatile ("pause" ::: "memory"); __asm__ volatile ("pause" ::: "memory");
} }
#elif defined(__arm__) || defined(__aarch64__) #elif (defined(__arm__) && __ARM_ARCH__ >= 7) || defined(__aarch64__)
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ volatile("yield"); __asm__ volatile("yield" ::: "memory");
} }
#endif #endif
#elif defined(__sun)
// Fallback for other archs
#include <synch.h>
static inline void mi_atomic_yield(void) {
smt_pause();
}
#elif defined(__wasi__) #elif defined(__wasi__)
#include <sched.h> #include <sched.h>
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
@ -305,4 +311,4 @@ static inline void mi_atomic_yield(void) {
#endif #endif
#endif // __MIMALLOC_ATOMIC_H #endif // __MIMALLOC_ATOMIC_H

View file

@ -24,7 +24,7 @@ not accidentally mix pointers from different allocators).
#define free(p) mi_free(p) #define free(p) mi_free(p)
#define strdup(s) mi_strdup(s) #define strdup(s) mi_strdup(s)
#define strndup(s) mi_strndup(s) #define strndup(s,n) mi_strndup(s,n)
#define realpath(f,n) mi_realpath(f,n) #define realpath(f,n) mi_realpath(f,n)
// Microsoft extensions // Microsoft extensions
@ -33,7 +33,7 @@ not accidentally mix pointers from different allocators).
#define _recalloc(p,n,c) mi_recalloc(p,n,c) #define _recalloc(p,n,c) mi_recalloc(p,n,c)
#define _strdup(s) mi_strdup(s) #define _strdup(s) mi_strdup(s)
#define _strndup(s) mi_strndup(s) #define _strndup(s,n) mi_strndup(s,n)
#define _wcsdup(s) (wchar_t*)mi_wcsdup((const unsigned short*)(s)) #define _wcsdup(s) (wchar_t*)mi_wcsdup((const unsigned short*)(s))
#define _mbsdup(s) mi_mbsdup(s) #define _mbsdup(s) mi_mbsdup(s)
#define _dupenv_s(b,n,v) mi_dupenv_s(b,n,v) #define _dupenv_s(b,n,v) mi_dupenv_s(b,n,v)

View file

@ -102,6 +102,8 @@ free list encoding](https://github.com/microsoft/mimalloc/blob/783e3377f79ee82af
Special thanks to: Special thanks to:
* [David Carlier](https://devnexen.blogspot.com/) (@devnexen) for his many contributions, and making
mimalloc work better on many less common operating systems, like Haiku, Dragonfly, etc.
* Mary Feofanova (@mary3000), Evgeniy Moiseenko, and Manuel Pöter (@mpoeter) for making mimalloc TSAN checkable, and finding * Mary Feofanova (@mary3000), Evgeniy Moiseenko, and Manuel Pöter (@mpoeter) for making mimalloc TSAN checkable, and finding
memory model bugs using the [genMC] model checker. memory model bugs using the [genMC] model checker.
* Weipeng Liu (@pongba), Zhuowei Li, Junhua Wang, and Jakub Szymanski, for their early support of mimalloc and deployment * Weipeng Liu (@pongba), Zhuowei Li, Junhua Wang, and Jakub Szymanski, for their early support of mimalloc and deployment
@ -112,6 +114,14 @@ Special thanks to:
[genMC]: https://plv.mpi-sws.org/genmc/ [genMC]: https://plv.mpi-sws.org/genmc/
### Usage
mimalloc is used in various large scale low-latency services and programs, for example:
<a href="https://www.bing.com"><img align="left" height="50" src="https://upload.wikimedia.org/wikipedia/commons/e/e9/Bing_logo.svg"></a>
<a href="https://azure.microsoft.com/"><img align="left" height="50" src="https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg"></a>
<a href="https://deathstrandingpc.505games.com"><img height="100" src="doc/ds-logo.jpg" style="border-radius=1ex;vertical-align:center"></a>
# Building # Building
## Windows ## Windows