Skip to content

Commit a75b0a7

Browse files
committed
Merge 4.1.1 e02b83c May 3, 2016 remote-tracking branch 'github/master'
2 parents 06efd85 + e02b83c commit a75b0a7

23 files changed

+329
-152
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ set(TESTS_UNIT
656656
test/unit/bitmap.c
657657
test/unit/ckh.c
658658
test/unit/decay.c
659+
test/unit/fork.c
659660
test/unit/hash.c
660661
test/unit/junk.c
661662
test/unit/junk_alloc.c

ChangeLog

+21
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ brevity. Much more detail can be found in the git revision history:
44

55
https://github.com/jemalloc/jemalloc
66

7+
* 4.1.1 (May 3, 2016)
8+
9+
This bugfix release resolves a variety of mostly minor issues, though the
10+
bitmap fix is critical for 64-bit Windows.
11+
12+
Bug fixes:
13+
- Fix the linear scan version of bitmap_sfu() to shift by the proper amount
14+
even when sizeof(long) is not the same as sizeof(void *), as on 64-bit
15+
Windows. (@jasone)
16+
- Fix hashing functions to avoid unaligned memory accesses (and resulting
17+
crashes). This is relevant at least to some ARM-based platforms.
18+
(@rkmisra)
19+
- Fix fork()-related lock rank ordering reversals. These reversals were
20+
unlikely to cause deadlocks in practice except when heap profiling was
21+
enabled and active. (@jasone)
22+
- Fix various chunk leaks in OOM code paths. (@jasone)
23+
- Fix malloc_stats_print() to print opt.narenas correctly. (@jasone)
24+
- Fix MSVC-specific build/test issues. (@rustyx, yuslepukhin)
25+
- Fix a variety of test failures that were due to test fragility rather than
26+
core bugs. (@jasone)
27+
728
* 4.1.0 (February 28, 2016)
829

930
This release is primarily about optimizations, but it also incorporates a lot

Makefile.in

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ TESTS_UNIT := $(srcroot)test/unit/atomic.c \
138138
$(srcroot)test/unit/bitmap.c \
139139
$(srcroot)test/unit/ckh.c \
140140
$(srcroot)test/unit/decay.c \
141+
$(srcroot)test/unit/fork.c \
141142
$(srcroot)test/unit/hash.c \
142143
$(srcroot)test/unit/junk.c \
143144
$(srcroot)test/unit/junk_alloc.c \

doc/jemalloc.xml.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ for (i = 0; i < nbins; i++) {
10161016
allocate memory during application initialization and then deadlock
10171017
internally when jemalloc in turn calls
10181018
<function>atexit<parameter/></function>, so this option is not
1019-
univerally usable (though the application can register its own
1019+
universally usable (though the application can register its own
10201020
<function>atexit<parameter/></function> function with equivalent
10211021
functionality). Therefore, this option should only be used with care;
10221022
it is primarily intended as a performance tuning aid during application
@@ -1320,7 +1320,7 @@ malloc_conf = "xmalloc:true";]]></programlisting>
13201320
option. Note that <function>atexit<parameter/></function> may allocate
13211321
memory during application initialization and then deadlock internally
13221322
when jemalloc in turn calls <function>atexit<parameter/></function>, so
1323-
this option is not univerally usable (though the application can
1323+
this option is not universally usable (though the application can
13241324
register its own <function>atexit<parameter/></function> function with
13251325
equivalent functionality). This option is disabled by
13261326
default.</para></listitem>
@@ -2062,7 +2062,7 @@ typedef struct {
20622062
[<option>--enable-prof</option>]
20632063
</term>
20642064
<listitem><para>Average number of bytes allocated between
2065-
inverval-based profile dumps. See the
2065+
interval-based profile dumps. See the
20662066
<link
20672067
linkend="opt.lg_prof_interval"><mallctl>opt.lg_prof_interval</mallctl></link>
20682068
option for additional information.</para></listitem>

include/jemalloc/internal/arena.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,10 @@ void arena_nthreads_inc(arena_t *arena);
584584
void arena_nthreads_dec(arena_t *arena);
585585
arena_t *arena_new(unsigned ind);
586586
bool arena_boot(void);
587-
void arena_prefork(arena_t *arena);
587+
void arena_prefork0(arena_t *arena);
588+
void arena_prefork1(arena_t *arena);
589+
void arena_prefork2(arena_t *arena);
590+
void arena_prefork3(arena_t *arena);
588591
void arena_postfork_parent(arena_t *arena);
589592
void arena_postfork_child(arena_t *arena);
590593

include/jemalloc/internal/bitmap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo)
223223
i++;
224224
g = bitmap[i];
225225
}
226-
bit = (bit - 1) + (i << 6);
226+
bit = (bit - 1) + (i << LG_BITMAP_GROUP_NBITS);
227227
#endif
228228
bitmap_set(bitmap, binfo, bit);
229229
return (bit);

include/jemalloc/internal/chunk.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,8 @@ void *chunk_alloc_wrapper(arena_t *arena, chunk_hooks_t *chunk_hooks,
6262
void *new_addr, size_t size, size_t alignment, bool *zero, bool *commit);
6363
void chunk_dalloc_cache(arena_t *arena, chunk_hooks_t *chunk_hooks,
6464
void *chunk, size_t size, bool committed);
65-
void chunk_dalloc_arena(arena_t *arena, chunk_hooks_t *chunk_hooks,
66-
void *chunk, size_t size, bool zeroed, bool committed);
6765
void chunk_dalloc_wrapper(arena_t *arena, chunk_hooks_t *chunk_hooks,
68-
void *chunk, size_t size, bool committed);
69-
bool chunk_purge_arena(arena_t *arena, void *chunk, size_t offset,
70-
size_t length);
66+
void *chunk, size_t size, bool zeroed, bool committed);
7167
bool chunk_purge_wrapper(arena_t *arena, chunk_hooks_t *chunk_hooks,
7268
void *chunk, size_t size, size_t offset, size_t length);
7369
bool chunk_boot(void);

include/jemalloc/internal/hash.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ hash_get_block_32(const uint32_t *p, int i)
5353
if (unlikely((uintptr_t)p & (sizeof(uint32_t)-1)) != 0) {
5454
uint32_t ret;
5555

56-
memcpy(&ret, &p[i], sizeof(uint32_t));
56+
memcpy(&ret, (uint8_t *)(p + i), sizeof(uint32_t));
5757
return (ret);
5858
}
5959

@@ -68,7 +68,7 @@ hash_get_block_64(const uint64_t *p, int i)
6868
if (unlikely((uintptr_t)p & (sizeof(uint64_t)-1)) != 0) {
6969
uint64_t ret;
7070

71-
memcpy(&ret, &p[i], sizeof(uint64_t));
71+
memcpy(&ret, (uint8_t *)(p + i), sizeof(uint64_t));
7272
return (ret);
7373
}
7474

include/jemalloc/internal/private_symbols.txt

+42-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ arena_dalloc
2121
arena_dalloc_bin
2222
arena_dalloc_bin_junked_locked
2323
arena_dalloc_junk_large
24+
arena_dalloc_junk_large_impl
2425
arena_dalloc_junk_small
26+
arena_dalloc_junk_small_impl
2527
arena_dalloc_large
2628
arena_dalloc_large_junked_locked
2729
arena_dalloc_small
@@ -81,7 +83,10 @@ arena_nthreads_inc
8183
arena_palloc
8284
arena_postfork_child
8385
arena_postfork_parent
84-
arena_prefork
86+
arena_prefork0
87+
arena_prefork1
88+
arena_prefork2
89+
arena_prefork3
8590
arena_prof_accum
8691
arena_prof_accum_impl
8792
arena_prof_accum_locked
@@ -123,6 +128,11 @@ atomic_sub_u
123128
atomic_sub_uint32
124129
atomic_sub_uint64
125130
atomic_sub_z
131+
atomic_write_p
132+
atomic_write_u
133+
atomic_write_uint32
134+
atomic_write_uint64
135+
atomic_write_z
126136
base_alloc
127137
base_boot
128138
base_postfork_child
@@ -148,7 +158,6 @@ chunk_alloc_dss
148158
chunk_alloc_mmap
149159
chunk_alloc_wrapper
150160
chunk_boot
151-
chunk_dalloc_arena
152161
chunk_dalloc_cache
153162
chunk_dalloc_mmap
154163
chunk_dalloc_wrapper
@@ -168,7 +177,6 @@ chunk_npages
168177
chunk_postfork_child
169178
chunk_postfork_parent
170179
chunk_prefork
171-
chunk_purge_arena
172180
chunk_purge_wrapper
173181
chunk_register
174182
chunks_rtree
@@ -200,6 +208,8 @@ extent_node_addr_get
200208
extent_node_addr_set
201209
extent_node_arena_get
202210
extent_node_arena_set
211+
extent_node_committed_get
212+
extent_node_committed_set
203213
extent_node_dirty_insert
204214
extent_node_dirty_linkage_init
205215
extent_node_dirty_remove
@@ -210,6 +220,8 @@ extent_node_size_get
210220
extent_node_size_set
211221
extent_node_zeroed_get
212222
extent_node_zeroed_set
223+
extent_tree_ad_destroy
224+
extent_tree_ad_destroy_recurse
213225
extent_tree_ad_empty
214226
extent_tree_ad_first
215227
extent_tree_ad_insert
@@ -227,6 +239,8 @@ extent_tree_ad_reverse_iter
227239
extent_tree_ad_reverse_iter_recurse
228240
extent_tree_ad_reverse_iter_start
229241
extent_tree_ad_search
242+
extent_tree_szad_destroy
243+
extent_tree_szad_destroy_recurse
230244
extent_tree_szad_empty
231245
extent_tree_szad_first
232246
extent_tree_szad_insert
@@ -304,6 +318,7 @@ jemalloc_postfork_parent
304318
jemalloc_prefork
305319
large_maxclass
306320
lg_floor
321+
lg_prof_sample
307322
malloc_cprintf
308323
malloc_mutex_init
309324
malloc_mutex_lock
@@ -331,6 +346,8 @@ narenas_tdata_cleanup
331346
narenas_total_get
332347
ncpus
333348
nhbins
349+
nhclasses
350+
nlclasses
334351
nstime_add
335352
nstime_compare
336353
nstime_copy
@@ -344,6 +361,7 @@ nstime_nsec
344361
nstime_sec
345362
nstime_subtract
346363
nstime_update
364+
nstime_update_impl
347365
opt_abort
348366
opt_decay_time
349367
opt_dss
@@ -384,6 +402,7 @@ pow2_ceil_u64
384402
pow2_ceil_zu
385403
prng_lg_range
386404
prng_range
405+
prof_active
387406
prof_active_get
388407
prof_active_get_unlocked
389408
prof_active_set
@@ -393,6 +412,7 @@ prof_backtrace
393412
prof_boot0
394413
prof_boot1
395414
prof_boot2
415+
prof_bt_count
396416
prof_dump_header
397417
prof_dump_open
398418
prof_free
@@ -410,7 +430,8 @@ prof_malloc_sample_object
410430
prof_mdump
411431
prof_postfork_child
412432
prof_postfork_parent
413-
prof_prefork
433+
prof_prefork0
434+
prof_prefork1
414435
prof_realloc
415436
prof_reset
416437
prof_sample_accum_update
@@ -419,6 +440,7 @@ prof_tctx_get
419440
prof_tctx_reset
420441
prof_tctx_set
421442
prof_tdata_cleanup
443+
prof_tdata_count
422444
prof_tdata_get
423445
prof_tdata_init
424446
prof_tdata_reinit
@@ -506,6 +528,13 @@ ticker_tick
506528
ticker_ticks
507529
tsd_arena_get
508530
tsd_arena_set
531+
tsd_arenap_get
532+
tsd_arenas_tdata_bypass_get
533+
tsd_arenas_tdata_bypass_set
534+
tsd_arenas_tdata_bypassp_get
535+
tsd_arenas_tdata_get
536+
tsd_arenas_tdata_set
537+
tsd_arenas_tdatap_get
509538
tsd_boot
510539
tsd_boot0
511540
tsd_boot1
@@ -514,6 +543,9 @@ tsd_cleanup
514543
tsd_cleanup_wrapper
515544
tsd_fetch
516545
tsd_get
546+
tsd_narenas_tdata_get
547+
tsd_narenas_tdata_set
548+
tsd_narenas_tdatap_get
517549
tsd_wrapper_get
518550
tsd_wrapper_set
519551
tsd_initialized
@@ -523,17 +555,23 @@ tsd_init_head
523555
tsd_nominal
524556
tsd_prof_tdata_get
525557
tsd_prof_tdata_set
558+
tsd_prof_tdatap_get
526559
tsd_quarantine_get
527560
tsd_quarantine_set
561+
tsd_quarantinep_get
528562
tsd_set
529563
tsd_tcache_enabled_get
530564
tsd_tcache_enabled_set
565+
tsd_tcache_enabledp_get
531566
tsd_tcache_get
532567
tsd_tcache_set
568+
tsd_tcachep_get
533569
tsd_thread_allocated_get
534570
tsd_thread_allocated_set
571+
tsd_thread_allocatedp_get
535572
tsd_thread_deallocated_get
536573
tsd_thread_deallocated_set
574+
tsd_thread_deallocatedp_get
537575
tsd_tls
538576
tsd_tsd
539577
u2rz

include/jemalloc/internal/prof.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ bool prof_gdump_set(bool active);
316316
void prof_boot0(void);
317317
void prof_boot1(void);
318318
bool prof_boot2(void);
319-
void prof_prefork(void);
319+
void prof_prefork0(void);
320+
void prof_prefork1(void);
320321
void prof_postfork_parent(void);
321322
void prof_postfork_child(void);
322323
void prof_sample_threshold_update(prof_tdata_t *tdata);

msvc/projects/vc2015/jemalloc/jemalloc.vcxproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<ClInclude Include="..\..\..\..\include\jemalloc\internal\jemalloc_internal_macros.h" />
5555
<ClInclude Include="..\..\..\..\include\jemalloc\internal\mb.h" />
5656
<ClInclude Include="..\..\..\..\include\jemalloc\internal\mutex.h" />
57+
<ClInclude Include="..\..\..\..\include\jemalloc\internal\nstime.h" />
5758
<ClInclude Include="..\..\..\..\include\jemalloc\internal\pages.h" />
5859
<ClInclude Include="..\..\..\..\include\jemalloc\internal\private_namespace.h" />
5960
<ClInclude Include="..\..\..\..\include\jemalloc\internal\private_unnamespace.h" />
@@ -69,6 +70,7 @@
6970
<ClInclude Include="..\..\..\..\include\jemalloc\internal\size_classes.h" />
7071
<ClInclude Include="..\..\..\..\include\jemalloc\internal\stats.h" />
7172
<ClInclude Include="..\..\..\..\include\jemalloc\internal\tcache.h" />
73+
<ClInclude Include="..\..\..\..\include\jemalloc\internal\ticker.h" />
7274
<ClInclude Include="..\..\..\..\include\jemalloc\internal\tsd.h" />
7375
<ClInclude Include="..\..\..\..\include\jemalloc\internal\util.h" />
7476
<ClInclude Include="..\..\..\..\include\jemalloc\internal\valgrind.h" />
@@ -103,11 +105,13 @@
103105
<ClCompile Include="..\..\..\..\src\mutex.c" />
104106
<ClCompile Include="..\..\..\..\src\nstime.c" />
105107
<ClCompile Include="..\..\..\..\src\pages.c" />
108+
<ClCompile Include="..\..\..\..\src\prng.c" />
106109
<ClCompile Include="..\..\..\..\src\prof.c" />
107110
<ClCompile Include="..\..\..\..\src\quarantine.c" />
108111
<ClCompile Include="..\..\..\..\src\rtree.c" />
109112
<ClCompile Include="..\..\..\..\src\stats.c" />
110113
<ClCompile Include="..\..\..\..\src\tcache.c" />
114+
<ClCompile Include="..\..\..\..\src\ticker.c" />
111115
<ClCompile Include="..\..\..\..\src\tsd.c" />
112116
<ClCompile Include="..\..\..\..\src\util.c" />
113117
</ItemGroup>
@@ -227,7 +231,7 @@
227231
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'">
228232
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
229233
<IntDir>$(Platform)\$(Configuration)\</IntDir>
230-
<TargetName>$(ProjectName)-$(PlatformToolset)-$(Configuration)</TargetName>
234+
<TargetName>$(ProjectName)-vc$(PlatformToolsetVersion)-$(Configuration)</TargetName>
231235
</PropertyGroup>
232236
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
233237
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
@@ -236,7 +240,7 @@
236240
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'">
237241
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
238242
<IntDir>$(Platform)\$(Configuration)\</IntDir>
239-
<TargetName>$(ProjectName)-$(PlatformToolset)-$(Configuration)</TargetName>
243+
<TargetName>$(ProjectName)-vc$(PlatformToolsetVersion)-$(Configuration)</TargetName>
240244
</PropertyGroup>
241245
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
242246
<ClCompile>

0 commit comments

Comments
 (0)