Skip to content

Commit 80daac0

Browse files
authored
Merge develop for 1.4.3 release
2 parents 79d4916 + bfd26a7 commit 80daac0

File tree

10 files changed

+182
-102
lines changed

10 files changed

+182
-102
lines changed

CHANGELOG

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
1.4.3
2+
3+
Fixed an issue where certain combinations of memory page size and span map counts could cause
4+
a deadlock in the mapping of new memory pages.
5+
6+
Tweaked cache levels and avoid setting spans as reserved in a heap when the heap already has
7+
spans in the thread cache to improve cache usage.
8+
9+
Prefer flags to more actively evict physical pages in madvise calls when partially unmapping
10+
span ranges on POSIX systems.
11+
12+
113
1.4.2
214

315
Fixed an issue where calling _exit might hang the main thread cleanup in rpmalloc if another
@@ -204,7 +216,7 @@ Provide malloc entry point replacements and automatic init/fini hooks, and a LD_
204216

205217
Improve documentation and additional code comments
206218

207-
Move benchmarks to separate repo, https://github.com/rampantpixels/rpmalloc-benchmark
219+
Move benchmarks to separate repo, https://github.com/mjansson/rpmalloc-benchmark
208220

209221

210222
1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# rpmalloc - General Purpose Memory Allocator
22
This library provides a public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C. The latest source code is always available at https://github.com/mjansson/rpmalloc
33

4-
Created by Mattias Jansson ([@maniccoder](https://twitter.com/maniccoder))
4+
Created by Mattias Jansson ([@maniccoder](https://twitter.com/maniccoder)) - Discord server for discussions at https://discord.gg/M8BwTQrt6c
55

66
Platforms currently supported:
77

build/ninja/msvc.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths
3131
self.linkcmd = '$toolchain$link $libpaths $configlibpaths $linkflags $linkarchflags $linkconfigflags /DEBUG /NOLOGO /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MANIFEST /MANIFESTUAC:\"level=\'asInvoker\' uiAccess=\'false\'\" /TLBID:1 /PDB:$pdbpath /OUT:$out $in $libs $archlibs $oslibs'
3232
self.dllcmd = self.linkcmd + ' /DLL'
3333

34-
self.cflags = ['/D', '"' + project.upper() + '_COMPILE=1"', '/D', '"_UNICODE"', '/D', '"UNICODE"', '/Zi', '/Oi', '/Oy-', '/GS-', '/Gy-', '/Qpar-', '/fp:fast', '/fp:except-', '/Zc:forScope', '/Zc:wchar_t', '/GR-', '/openmp-']
35-
self.cwarnflags = ['/W4', '/WX']
34+
self.cflags = ['/D', '"' + project.upper() + '_COMPILE=1"', '/D', '"_UNICODE"', '/D', '"UNICODE"', '/std:c17', '/Zi', '/Oi', '/Oy-', '/GS-', '/Gy-', '/Qpar-', '/fp:fast', '/fp:except-', '/Zc:forScope', '/Zc:wchar_t', '/GR-', '/openmp-']
35+
self.cwarnflags = ['/W4', '/WX', '/wd4201'] #Ignore nameless union/struct which is allowed in C11
3636
self.cmoreflags = []
3737
self.arflags = ['/ignore:4221'] #Ignore empty object file warning]
3838
self.linkflags = ['/DEBUG']
@@ -138,10 +138,11 @@ def build_toolchain(self):
138138
tools_list.sort(key=StrictVersion)
139139
self.toolchain = os.path.join(tools_basepath, tools_list[-1])
140140
self.toolchain_version = major_version + ".0"
141+
break
141142

142143
if self.toolchain == '':
143144
toolchain = ''
144-
versions = ['16.0', '15.0', '14.0', '13.0', '12.0', '11.0', '10.0']
145+
versions = ['17.0', '16.0', '15.0']
145146
keys = [
146147
'HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7',
147148
'HKCU\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7',
@@ -161,17 +162,18 @@ def build_toolchain(self):
161162
except:
162163
continue
163164
if not toolchain == '':
164-
if version == '15.0' or version == '16.0':
165-
tools_basepath = os.path.join(toolchain, 'VC', 'Tools', 'MSVC')
166-
tools_list = [item for item in os.listdir(tools_basepath) if os.path.isdir(os.path.join(tools_basepath, item))]
167-
from distutils.version import StrictVersion
168-
tools_list.sort(key=StrictVersion)
169-
toolchain = os.path.join(tools_basepath, tools_list[-1])
165+
tools_basepath = os.path.join(toolchain, 'VC', 'Tools', 'MSVC')
166+
tools_list = [item for item in os.listdir(tools_basepath) if os.path.isdir(os.path.join(tools_basepath, item))]
167+
from distutils.version import StrictVersion
168+
tools_list.sort(key=StrictVersion)
169+
toolchain = os.path.join(tools_basepath, tools_list[-1])
170170
self.toolchain = toolchain
171171
self.toolchain_version = version
172172
break
173173
if not self.toolchain == '':
174174
break
175+
if self.toolchain == '':
176+
raise Exception("Unable to locate any installed Visual Studio toolchain")
175177
self.includepaths += [os.path.join(self.toolchain, 'include')]
176178
if self.sdkpath == '':
177179
versions = ['v10.0', 'v8.1']
@@ -237,13 +239,10 @@ def make_libpaths(self, libpaths):
237239
return []
238240

239241
def make_arch_toolchain_path(self, arch):
240-
if self.toolchain_version == '15.0' or self.toolchain_version == '16.0':
241-
if arch == 'x86-64':
242-
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x64\\')
243-
elif arch == 'x86':
244-
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x86\\')
245242
if arch == 'x86-64':
246-
return os.path.join(self.toolchain, 'bin', 'amd64\\')
243+
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x64\\')
244+
elif arch == 'x86':
245+
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x86\\')
247246
return os.path.join(self.toolchain, 'bin\\')
248247

249248
def make_carchflags(self, arch, targettype):
@@ -321,20 +320,14 @@ def make_configlibpaths(self, config, arch, extralibpaths):
321320
libpaths += [os.path.join(libpath, self.libpath, config, arch) for libpath in extralibpaths]
322321
if self.sdkpath != '':
323322
if arch == 'x86':
324-
if self.toolchain_version == '15.0' or self.toolchain_version == '16.0':
325-
libpaths += [os.path.join(self.toolchain, 'lib', 'x86')]
326-
else:
327-
libpaths += [os.path.join(self.toolchain, 'lib')]
323+
libpaths += [os.path.join(self.toolchain, 'lib', 'x86')]
328324
if self.sdkversion == 'v8.1':
329325
libpaths += [os.path.join( self.sdkpath, 'lib', 'winv6.3', 'um', 'x86')]
330326
if self.sdkversion == 'v10.0':
331327
libpaths += [os.path.join(self.sdkpath, 'lib', self.sdkversionpath, 'um', 'x86')]
332328
libpaths += [os.path.join(self.sdkpath, 'lib', self.sdkversionpath, 'ucrt', 'x86')]
333329
else:
334-
if self.toolchain_version == '15.0' or self.toolchain_version == '16.0':
335-
libpaths += [os.path.join( self.toolchain, 'lib', 'x64')]
336-
else:
337-
libpaths += [os.path.join( self.toolchain, 'lib', 'amd64')]
330+
libpaths += [os.path.join( self.toolchain, 'lib', 'x64')]
338331
if self.sdkversion == 'v8.1':
339332
libpaths += [os.path.join( self.sdkpath, 'lib', 'winv6.3', 'um', 'x64')]
340333
if self.sdkversion == 'v10.0':

build/ninja/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def generate_version_string(libname):
1515
if sys.platform.startswith('win'):
1616
gitcmd = 'git.exe'
1717
try:
18-
git_version = subprocess.check_output( [ gitcmd, 'describe', '--long' ], stderr = subprocess.STDOUT ).strip()
18+
git_version = subprocess.check_output( [ gitcmd, 'describe', '--tags', '--long' ], stderr = subprocess.STDOUT ).strip()
1919
tokens = git_version.decode().split( '-' )
2020
version_numbers = tokens[0].split( '.' )
2121
except Exception:

build/ninja/vslocate.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,15 @@ class ISetupConfiguration(ctypes.Structure):
8888
ctypes.POINTER(ctypes.POINTER(ISetupConfiguration)),
8989
ctypes.c_void_p)
9090

91+
installations = []
92+
dll = None
93+
9194
dll_path = os.path.expandvars("$ProgramData\\Microsoft\\VisualStudio\\Setup\\x64\\Microsoft.VisualStudio.Setup.Configuration.Native.dll")
92-
dll = ctypes.WinDLL(dll_path)
95+
try:
96+
dll = ctypes.WinDLL(dll_path)
97+
except OSError as e:
98+
#print("Failed to load Visual Studio setup configuration DLL: " + str(e))
99+
return installations
93100

94101
params_get_setup_configuration = (1, "configuration", 0), (1, "reserved", 0),
95102

@@ -98,8 +105,6 @@ class ISetupConfiguration(ctypes.Structure):
98105
configuration = ctypes.POINTER(ISetupConfiguration)()
99106
reserved = ctypes.c_void_p(0)
100107

101-
installations = []
102-
103108
result = get_setup_configuration(ctypes.byref(configuration), reserved)
104109
if result != 0:
105110
#print("Failed to get setup configuration: " + str(result))
@@ -110,7 +115,7 @@ class ISetupConfiguration(ctypes.Structure):
110115
enum_setup_instances = ctypes.POINTER(IEnumSetupInstances)()
111116
result = enum_instances(configuration, ctypes.byref(enum_setup_instances))
112117
if result != 0:
113-
#print("Failed to enum setup instances: " + str(result))
118+
#print("Failed to enum setup instances: " + str(result))
114119
return installations
115120

116121

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import generator
1111

12-
generator = generator.Generator(project = 'rpmalloc', variables = [('bundleidentifier', 'com.rampantpixels.rpmalloc.$(binname)')])
12+
generator = generator.Generator(project = 'rpmalloc', variables = [('bundleidentifier', 'com.maniccoder.rpmalloc.$(binname)')])
1313

1414
rpmalloc_lib = generator.lib(module = 'rpmalloc', libname = 'rpmalloc', sources = ['rpmalloc.c'])
1515
rpmalloc_test_lib = generator.lib(module = 'rpmalloc', libname = 'rpmalloc-test', sources = ['rpmalloc.c'], variables = {'defines': ['ENABLE_ASSERTS=1', 'ENABLE_STATISTICS=1', 'RPMALLOC_FIRST_CLASS_HEAPS=1', 'RPMALLOC_CONFIGURABLE=1']})

0 commit comments

Comments
 (0)