aboutsummaryrefslogtreecommitdiff
path: root/contrib/jemalloc/include
Commit message (Collapse)AuthorAgeFilesLines
* jemalloc: avoid clash with C23 unreachable() macroRobert Clausecker2025-11-281-0/+3
| | | | | | | | | | Summary: This avoids a clash with the new macro in <stddef.h> introduced in D53967 Reviewed by: imp Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53968
* jemalloc: Remove bogus merge conflict markersWarner Losh2025-09-026-984/+0
| | | | | | | | | The merge markers were added, it seems, in one of my rebases. The HEAD entry is the merged code, as far as I can tell, and is what should be in the base. None of these files are used during the build. Noticed by: jhb Sponsored by: Netflix
* jemalloc: Merge from jemalloc 5.3.0 vendor branchWarner Losh2025-08-15122-3810/+11639
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings in a merge from jemalloc 5.3.0. It's almost fully scripted, except: Three conflicts resolved by hand: include/jemalloc/internal/test_hooks.h Use the new name src/extent.c Use the new code src/jemalloc.c Use the new code since je_realloc has moved The script is recorded in FREEBSD-upgrade. The old script did svn commands that were basically a rebase of our changes. This update has a series of diff reduction changes before this. Note: I'd planned on fixing the above three conflicts with commits, but ran out of time when I did this work in January. I got discouraged when jemalloc was EOL'd and didn't pick this back up. I did the above by hand to get this into FreeBSD 15.0 This work is a repeat of the work by Minsoo Choo who did all these changes and created a pull request. Given the importance of jemalloc, I audited these changes by redoing them in this series of commits (and with the script that was checked in). I did this to confince myself and anybody else in doubt that there was no supply chain attack. The diffs between this series of commits and Minsoo's work are minor (though the version skew makes adds some noise). Interested parties can independent audit each step, I hope. I've listed Minsoo as a co-author since without his pull request to test again, this wouldn't have been possible. Thanks to brooks@ for help with getting the jemalloc 3 ABI compat symbols right. Co-authored-by: Minsoo Choo <minsoochoo0122@proton.me> Pull Request: https://github.com/freebsd/freebsd-src/pull/1337 Sponsored by: Netflix
* jemalloc: Add JEMALLOC_PRIVATE_NAMESPACE for the libc namespaceWarner Losh2025-08-152-0/+4
| | | | | | | | | | | Gate the namespace dance on this define. This allows us to bootstrap new versions of jemalloc more easily. One of the steps of import is building to find what symbols need to be private. When we do that, we don't want to do this dance. No functional change. Sponsored by: Netflix
* jemalloc: Add FreeBSD's updates to jemalloc_preamble.h.inWarner Losh2025-08-151-7/+4
| | | | | | | | | jemalloc_preample.h is generated, and FreeBSD has made some changes which we update using configure, etc on version updates. No functional change. Sponsored by: Netflix
* jemalloc: Unthin contrib/jemallocWarner Losh2025-08-1520-0/+1790
| | | | | | | | | | | | Add back more of the release for jemalloc for easier imports that can be audited for stray changes simply. However, trim out tests and msvc project files since they are easy and account for over half the size of the distro. No functional change. Sponsored by: Netflix
* Revert "jemalloc: Reduce diffs to 5.2.1 revert to using JEMALLOC_FALLTHROUGH"Warner Losh2024-12-151-1/+1
| | | | | | | | | This reverts commit 7bcf5319c1106b761bcb2a4facfeccf1b9db758d. Turns out this is needed for gcc, at least through gcc 14. This wasn't documented it the import when it came in, so revert with this note. Sponsored by: Netflix
* jemalloc: Reduce diffs to 5.2.1 revert to using JEMALLOC_FALLTHROUGHWarner Losh2024-12-131-1/+1
| | | | | | | | | In the import of 5.2.1 (c5ad81420c495), JEMALLOC_FALLTHROUGH was changed to break (judging by the tagged upstream sources). This changes it back to upstream. No functional change: this is just a textual change (though the fallthrough macro doesn't expand to break). Sponsored by: Netflix
* jemalloc: Move generated files into lib/libc treeWarner Losh2024-12-138-1737/+0
| | | | | | | | | | | | | | | Make it easire to update jemalloc by moving the FreeBSD specific files and the generated files into lib/libc. This allows us to regenerate them more easily, and emphasizes a bit that we may have to regenerate stuff from upstream. This is necessary to also unthin the import from the vendor branch as well (which will be needed to simplify the imports in the future since we are trying to use contrib/jemalloc for two different things). No functional change. Sponsored by: Netflix
* jemalloc: set LG_VADDR to 64 on amd64Konstantin Belousov2024-09-261-0/+4
| | | | | | | | | | | and allow to revert it back to 48 with WITHOUT_JEMALLOC_LG_VADDR_WIDE build option. Reviewed by: andrew, emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46686
* jemalloc: don't expose 3.0 compat symbolsBrooks Davis2024-08-221-11/+15
| | | | | | | | | | | | Don't provide default linkage for jemalloc 3.0 compatability symbols. We stopped declaring these interfaces with the introduction of jemalloc 4.0 prior to FreeBSD 11.0. Any code using them would have had to declare them manually so stop declaring them and export the symbols directly for compatability. Arguably they should be x86 only as they were never declared on other Tier-1 architectures. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D46407
* powerpc: enable initial-exec TLSPiotr Kubaj2022-02-221-0/+2
| | | | | | | | | | | | | Summary: Use initial-exec, like other architectures. While here, switch MACHINE_ARCH in lib/libc/Makefile to LIBC_ARCH and consistently use powerpc. Subscribers: imp, #contributor_reviews_base Differential Revision: https://reviews.freebsd.org/D34315 Reviewed by: luporl MFC after: 2 weeks
* Set LG_VADDR to 48 on RISC-V.Brooks Davis2020-05-041-1/+1
| | | | | | | | | | | | | | The Sv48 PTE format is the largest currently defined address space for RISC-V. It makes no sense to define a larger size and doing so (at least for 64-bits) forces rtrees down a slow path. Reviewed by: vangyzen, jhb, mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24658 Notes: svn path=/head/; revision=360635
* Update jemalloc to version 5.2.1Eric van Gyzen2020-04-2368-6255/+2181
| | | | | | | | | | | | | | | | | | | Revert r354606 to restore r354605. Apply one line from jemalloc commit d01b425e5d1e1 in hash_x86_128() to fix the build with gcc, which only allows a fallthrough attribute to appear before a case or default label. Submitted by: jasone in r354605 Discussed with: jasone Reviewed by: bdrewery MFC after: never, due to gcc 4.2.1 Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24522 Notes: svn path=/head/; revision=360233
* Make jemalloc(3) default to retain:true on 64-bit platforms,Edward Tomasz Napierala2020-03-311-0/+4
| | | | | | | | | | | | | | | like it already does on Linux and OSX. This results in significantly fewer calls to mmap(2). This should result in a small reduction in system CPU time and improved superpage usage. Reviewed by: markj Tested by: markj MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23874 Notes: svn path=/head/; revision=359481
* Revert r354605: Update jemalloc to version 5.2.1.Jason Evans2019-11-1168-2181/+6255
| | | | | | | Compilation fails for non-llvm-based platforms. Notes: svn path=/head/; revision=354606
* Update jemalloc to version 5.2.1.Jason Evans2019-11-1168-6255/+2181
| | | | Notes: svn path=/head/; revision=354605
* Update jemalloc to version 5.1.0.Jason Evans2018-05-1152-499/+1662
| | | | Notes: svn path=/head/; revision=333477
* Account for the fact that jemalloc 5.0.0 dropped STATIC_PAGE_SHIFTMarius Strobl2018-01-311-2/+2
| | | | | | | | | | in favor for using LG_PAGE directly and, thus, for the fact that host and target don't necessarily use pages of the same sizes. Approved by: jasone Notes: svn path=/head/; revision=328639
* Relax too restrictive assert.Michal Meloun2017-12-101-1/+2
| | | | | | | | | | | The problem has been reported to upstream and similar change will be included in next jemalloc release. Submitted by: David Goldblatt <davidtgoldblatt@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=326742
* Revert r326740. I committed wrong diff.Michal Meloun2017-12-101-2/+0
| | | | Notes: svn path=/head/; revision=326741
* Relax too restrictive assert.Michal Meloun2017-12-101-0/+2
| | | | | | | | | | | The problem has been reported to upstream and similar change will be included in next jemalloc release. Submitted by: David Goldblatt <davidtgoldblatt@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=326740
* After jemalloc was updated to version 5.0.0 in r319971, i386 executablesDimitry Andric2017-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | linked with AddressSanitizer (even those linked on earlier versions of FreeBSD, or with external versions of clang) started failing with errors similar to: ==14688==AddressSanitizer CHECK failed: /usr/src/contrib/compiler-rt/lib/asan/asan_poisoning.cc:36 "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0) This is because AddressSanitizer expects all the TLS data in the program to be aligned to at least 8 bytes. Before the jemalloc 5.0.0 update, all the TLS data in the i386 version of libc.so added up to 80 bytes (a multiple of 8), but 5.0.0 made this grow to 2404 bytes (not a multiple of 8). This is due to added caching data in jemalloc's internal struct tsd_s. To fix AddressSanitizer, ensure this struct is aligned to at least 16 bytes, which can be done unconditionally for all architectures. (An earlier version of the fix aligned the struct to 8 bytes, but only for ILP32 architectures. This was deemed unnecessarily complicated.) PR: 221337 X-MFC-With: r319971 Notes: svn path=/head/; revision=324938
* Pick 'Remove external linkage for spin_adaptive' from upstream jemallocRyan Libby2017-08-091-7/+1
| | | | | | | | | | | | | Apply the changes from upstream jemalloc 048c6679. This is actually not quite a cherry pick due to makefile difference and because FreeBSD does not carry the msvc project files which were also modified in that commit. Approved by: jasone (maintainer), markj (mentor) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=322332
* o Replace __riscv__ with __riscvRuslan Bukin2017-08-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
* Update jemalloc to 5.0.1.Jason Evans2017-07-0311-19/+42
| | | | Notes: svn path=/head/; revision=320623
* Default the abort_conf malloc option to false.Jason Evans2017-06-301-1/+1
| | | | | | | This avoids troublesome backward compatibility issues. Notes: svn path=/head/; revision=320504
* Update jemalloc to 5.0.0.Jason Evans2017-06-1595-13987/+13555
| | | | Notes: svn path=/head/; revision=319971
* Update jemalloc to 4.5.0.Jason Evans2017-03-0212-40/+102
| | | | Notes: svn path=/head/; revision=314529
* Update jemalloc to 4.4.0.Jason Evans2016-12-0411-70/+140
| | | | Notes: svn path=/head/; revision=309540
* Update jemalloc to 4.3.1.Jason Evans2016-11-0921-5236/+5639
| | | | Notes: svn path=/head/; revision=308473
* Update jemalloc to 4.2.1.Jason Evans2016-06-093-6/+7
| | | | Notes: svn path=/head/; revision=301718
* Work around invalid gcc warning (explicit cast apparently lost).Jason Evans2016-05-131-0/+10
| | | | Notes: svn path=/head/; revision=299700
* Update jemalloc to 4.2.0.Jason Evans2016-05-1327-486/+1430
| | | | Notes: svn path=/head/; revision=299587
* Stop using sbrk(2) with malloc. This helps reduce the number of placesAndrew Turner2016-04-281-0/+2
| | | | | | | | | | | within the tree where we call this legacy interface. Reviewed by: jasone Obtained from: brooks Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=298741
* Add a cast to prevent a compiler warning.Jason Evans2016-03-031-1/+1
| | | | Notes: svn path=/head/; revision=296332
* Restore configuration for RISC-V.Ruslan Bukin2016-03-011-0/+3
| | | | Notes: svn path=/head/; revision=296271
* Update jemalloc to 4.1.0.Jason Evans2016-02-2926-679/+1386
| | | | | | | | | | | | | Add missing Symbol.map entry for __aligned_alloc. Add weak-->strong symbol binding for {malloc_stats_print,mallctl,mallctlnametomib,mallctlbymib} --> {__malloc_stats_print,__mallctl,__mallctlnametomib,__mallctlbymib}. These bindings complete the set necessary to allow applications to replace all malloc-related symbols. Notes: svn path=/head/; revision=296221
* Add configuration for RISC-V ISA.Ruslan Bukin2016-01-222-0/+6
| | | | | | | | | | Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5020 Notes: svn path=/head/; revision=294573
* Update jemalloc to version 4.0.4.Jason Evans2015-10-242-3/+7
| | | | Notes: svn path=/head/; revision=289900
* Update jemalloc to 4.0.2.Jason Evans2015-09-229-93/+221
| | | | Notes: svn path=/head/; revision=288090
* Define CPU_SPINWAIT as cpu_spinwait().Jason Evans2015-08-181-7/+5
| | | | | | | Submitted by: cem Notes: svn path=/head/; revision=286907
* Re-add LG_SIZEOF_PTR definition for __aarch64__.Jason Evans2015-08-181-0/+3
| | | | | | | This definition was erroneously removed during the 4.0.0 import. Notes: svn path=/head/; revision=286877
* Fix build failure due to missing CPU_SPINWAIT definition.Jason Evans2015-08-181-0/+4
| | | | Notes: svn path=/head/; revision=286871
* Add jemalloc support for 8 KiB, 16 KiB, and 64 KiB pages.Jason Evans2015-08-181-0/+4146
| | | | Notes: svn path=/head/; revision=286870
* Update jemalloc to version 4.0.0.Jason Evans2015-08-1836-2700/+5274
| | | | Notes: svn path=/head/; revision=286866
* Add aarch64 (arm64) #define for jemallocEd Maste2015-03-121-0/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=279909
* Fix known issues which blow up the process after dlopen("libthr.so")Konstantin Belousov2015-01-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or loading a dso linked to libthr.so into process which was not linked against threading library). - Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries. - Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization. - Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary. In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr. Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen. No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=276630
* Update jemalloc to version 3.6.0.Jason Evans2014-03-316-13/+19
| | | | Notes: svn path=/head/; revision=263974
* Update jemalloc to version 3.5.1.Jason Evans2014-02-264-4/+15
| | | | Notes: svn path=/head/; revision=262521