server-skynet-source-3rd-je.../src
Mark Santaniello 8b2c2a596d Support C++17 over-aligned allocation
Summary:
Add support for C++17 over-aligned allocation:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html

Supporting all 10 operators means we avoid thunking thru libstdc++-v3/libsupc++ and just call jemalloc directly.

It's also worth noting that there is now an aligned *and sized* operator delete:
```
void operator delete(void* ptr, std::size_t size, std::align_val_t al) noexcept;
```

If JeMalloc did not provide this, the default implementation would ignore the size parameter entirely:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/del_opsa.cc#L30-L33

(I must also update ax_cxx_compile_stdcxx.m4 to a newer version with C++17 support.)

Test Plan:
Wrote a simple test that allocates and then deletes an over-aligned type:
```
struct alignas(32) Foo {};
Foo *f;

int main()
{
  f = new Foo;
  delete f;
}
```

Before this change, both new and delete go thru PLT, and we end up calling regular old free:
```
(gdb) disassemble
Dump of assembler code for function main():
...
   0x00000000004029b7 <+55>:    call   0x4022d0 <_ZnwmSt11align_val_t@plt>
...
   0x00000000004029d5 <+85>:    call   0x4022e0 <_ZdlPvmSt11align_val_t@plt>
...
(gdb) s
free (ptr=0x7ffff6408020) at /home/engshare/third-party2/jemalloc/master/src/jemalloc.git-trunk/src/jemalloc.c:2842
2842            if (!free_fastpath(ptr, 0, false)) {
```

After this change, we directly call new/delete and ultimately call sdallocx:
```
(gdb) disassemble
Dump of assembler code for function main():
...
   0x0000000000402b77 <+55>:    call   0x496ca0 <operator new(unsigned long, std::align_val_t)>
...
   0x0000000000402b95 <+85>:    call   0x496e60 <operator delete(void*, unsigned long, std::align_val_t)>
...
(gdb) s
116             je_sdallocx_noflags(ptr, size);
```
2019-11-22 10:14:16 -08:00
..
arena.c Refactor arena_bin_malloc_hard(). 2019-11-21 11:41:26 -08:00
background_thread.c Extent -> Eset: Rename arena members. 2019-09-23 23:06:27 -07:00
base.c SC: Remove global data. 2018-07-23 13:37:08 -07:00
bin_info.c Extents: Split out extent struct. 2019-09-23 23:06:27 -07:00
bin.c Extents: Split out extent struct. 2019-09-23 23:06:27 -07:00
bitmap.c Revert "Remove BITMAP_USE_TREE." 2017-04-18 19:01:04 -07:00
ckh.c SC: Make some key size classes static. 2018-07-12 20:53:06 -07:00
ctl.c Reduce footprint of bin_t. 2019-11-21 11:08:36 -08:00
div.c Add the div module, which allows fast division by dynamic values. 2017-12-21 14:25:43 -08:00
eset.c Extent -> Eset: Move fork handling. 2019-09-23 23:06:27 -07:00
extent_dss.c Extents: Break extent-struct/arena interactions 2019-09-23 23:06:27 -07:00
extent_mmap.c Ensure page alignment on extent_alloc. 2019-04-04 13:49:37 -07:00
extent.c Rename tsd->offset_state to tsd->prng_state. 2019-11-11 10:35:37 -08:00
hash.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
hook.c Move tsd link and in_hook after tcache. 2018-06-27 13:39:02 -07:00
jemalloc_cpp.cpp Support C++17 over-aligned allocation 2019-11-22 10:14:16 -08:00
jemalloc.c Remove the unnecessary alloc_ctx on free_fastpath. 2019-11-16 13:41:13 -08:00
large.c Pull prof_accumbytes into thread event handler 2019-11-04 15:21:16 -08:00
log.c Logging: allow logging with empty varargs. 2017-07-22 09:38:19 -07:00
malloc_io.c Add -Wimplicit-fallthrough checks if supported 2019-11-08 13:03:03 -08:00
mutex_pool.c Header refactoring: unify and de-catchall mutex_pool. 2017-05-31 13:08:45 -07:00
mutex.c mutex: fix trylock spin wait contention 2018-11-28 15:17:02 -08:00
nstime.c Add background thread related stats. 2017-05-23 12:26:20 -07:00
pages.c use SYS_openat when available 2019-11-01 13:06:40 -07:00
prng.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
prof_data.c Refactor and optimize prof sampling initialization. 2019-11-11 10:35:37 -08:00
prof_log.c Fix amd64 MSVC warning 2019-10-18 10:16:29 -07:00
prof.c Refactor and optimize prof sampling initialization. 2019-11-11 10:35:37 -08:00
rtree.c Clean compilation -Wextra 2018-07-09 21:40:42 -07:00
safety_check.c Safety checks: Add a redzoning feature. 2019-04-15 16:48:12 -07:00
sc.c add a check for SC_LARGE_MAXCLASS 2018-10-15 08:24:12 -07:00
stats.c Add stats counters for number of zero reallocs 2019-10-29 17:48:44 -07:00
sz.c Move page quantization to sz module. 2019-09-23 23:06:27 -07:00
tcache.c Pull prof_accumbytes into thread event handler 2019-11-04 15:21:16 -08:00
test_hooks.c Rename hooks module to test_hooks. 2018-05-18 11:43:03 -07:00
thread_event.c Refactor and optimize prof sampling initialization. 2019-11-11 10:35:37 -08:00
ticker.c Header refactoring: Split up jemalloc_internal.h 2017-04-11 11:52:30 -07:00
tsd.c Refactor and optimize prof sampling initialization. 2019-11-11 10:35:37 -08:00
witness.c Header refactoring: unify and de-catchall witness code. 2017-05-24 15:27:30 -07:00
zone.c Fix deadlock in multithreaded fork in OS X. 2017-07-10 18:17:12 -07:00