|
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0 |
|
| #
ca80d1f4 |
| 22-Apr-2019 |
Konstantin Belousov <[email protected]> |
MFC r346225: Fix order of destructors between main binary and libraries.
|
|
Revision tags: release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0 |
|
| #
9851b340 |
| 30-Mar-2017 |
Konstantin Belousov <[email protected]> |
Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1.
Other needed supporting types, defines and constraint_handler infrastructure is added as specified in
Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1.
Other needed supporting types, defines and constraint_handler infrastructure is added as specified in the C11 spec.
Submitted by: Tom Rix <[email protected]> Sponsored by: Juniper Networks Discussed with: ed MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D9903 Differential revision: https://reviews.freebsd.org/D10161
show more ...
|
| #
b7c7684a |
| 07-Jan-2017 |
Konstantin Belousov <[email protected]> |
Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.
libstdc++ before gcc r244057 expected that libc provided __cxa_thread_atexit_impl, and libstdc++ implemented __cxa_thread_atexit,
Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.
libstdc++ before gcc r244057 expected that libc provided __cxa_thread_atexit_impl, and libstdc++ implemented __cxa_thread_atexit, by forwarding the calls to _impl. Mentioned gcc revision checks for __cxa_thread_atexit in libc and does not provide the symbol from libstdc++ if found.
This change helps older gcc, in particular, all released versions which implement thread_local, by consolidating the implementation into libc. For that versions, if configured with the current libc, the __cxa_thread_atexit is exported from libstdc++ as a trivial wrapper around libc::__cxa_thread_atexit_impl.
The __cxa_thread_atexit implementation is put into separate source file to allow for static linking with older libstdc++.a.
gcc bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78968 Reported by: Hannes Hauswedell <[email protected]> PR: 215709 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
|
Revision tags: release/11.0.1, release/11.0.0 |
|
| #
b585cd3e |
| 06-Aug-2016 |
Konstantin Belousov <[email protected]> |
Add __cxa_thread_atexit(3) API implementation.
This is the backing feature to implement C++11 thread storage duration specified by the thread_local keyword. A destructor for given thread-local obje
Add __cxa_thread_atexit(3) API implementation.
This is the backing feature to implement C++11 thread storage duration specified by the thread_local keyword. A destructor for given thread-local object is registered to be executed at the thread termination time using __cxa_thread_atexit(). Libc calls the __cxa_thread_calls_dtors() during exit(3), before finalizers and atexit functions, and libthr calls the function at the thread termination time, after the stack unwinding and thread-specific key destruction.
There are several uncertainties in the API which lacks a formal specification. Among them: - is it allowed to register destructors during destructing; we allow, but limiting the nesting level. If too many iterations detected, a diagnostic is issued to stderr and thread forcibly terminates for now. - how to handle destructors which belong to an unloading dso; for now, we ignore destructor calls for such entries, and issue a diagnostic. Linux does prevent dso unload until all threads with destructors from the dso terminated. It is supposed that the diagnostics allow to detect real-world applications relying on the above details and possibly adjust our implementation. Right now the choices were to provide the slim API (but that rarely stands the practice test).
Tests are added to check generic functionality and to specify some of the above implementation choices.
Submitted by: Mahdi Mokhtari <mokhi64_gmail.com> Reviewed by: theraven Discussed with: dim (detection of -std=c++11 supoort for tests) Sponsored by: The FreeBSD Foundation (my involvement) MFC after: 2 weeks Differential revisions: https://reviews.freebsd.org/D7224, https://reviews.freebsd.org/D7427
show more ...
|
|
Revision tags: release/10.3.0, release/10.2.0 |
|
| #
450dfafb |
| 01-May-2015 |
Baptiste Daroussin <[email protected]> |
Import reallocarray(3) from OpenBSD
Add a manpage for it, assign the copyright to the OpenBSD project on it since it is mostly copy/paste from OpenBSD manpage. style(9) fixes
Differential Revision:
Import reallocarray(3) from OpenBSD
Add a manpage for it, assign the copyright to the OpenBSD project on it since it is mostly copy/paste from OpenBSD manpage. style(9) fixes
Differential Revision: https://reviews.freebsd.org/D2420 Reviewed by: kib
show more ...
|
| #
8495e8b1 |
| 03-Jan-2015 |
Konstantin Belousov <[email protected]> |
Fix known issues which blow up the process after dlopen("libthr.so") (or loading a dso linked to libthr.so into process which was not linked against threading library).
- Remove libthr interposers o
Fix known issues which blow up the process after dlopen("libthr.so") (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
show more ...
|
|
Revision tags: release/10.1.0 |
|
| #
f4189cd6 |
| 01-Sep-2014 |
Pedro F. Giffuni <[email protected]> |
Add bsearch_b to the libc map and the stdlib header.
bsearch_b is the Apple blocks enabled version of bsearch(3). This was added to libc in Revision 264042 but the commit missed the declaration requ
Add bsearch_b to the libc map and the stdlib header.
bsearch_b is the Apple blocks enabled version of bsearch(3). This was added to libc in Revision 264042 but the commit missed the declaration required to make use of it.
While here move some other block-related functions to the BSD_VISIBLE block as these are non-standard.
Phabric: D638 Reviewed by: theraven, wollman
show more ...
|
| #
9823a90c |
| 21-Jul-2014 |
Pedro F. Giffuni <[email protected]> |
Add re-entrant versions of the hash functions based on the GNU api.
While testing this I found a conformance issue in hdestroy() that will be fixed in a subsequent commit.
Obtained from: NetBSD (hc
Add re-entrant versions of the hash functions based on the GNU api.
While testing this I found a conformance issue in hdestroy() that will be fixed in a subsequent commit.
Obtained from: NetBSD (hcreate.c, CVS Rev. 1.7)
show more ...
|
|
Revision tags: release/9.3.0 |
|
| #
4d1c5e03 |
| 03-Apr-2014 |
David Chisnall <[email protected]> |
Move _b functions into the 11.x symbol version namespace.
|
| #
46cdc140 |
| 02-Apr-2014 |
David Chisnall <[email protected]> |
Add support for some block functions that come from OS X. These are intended to build with any C compiler.
Reviewed by: pfg MFC after: 3 weeks
|
|
Revision tags: release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0 |
|
| #
a4bd5210 |
| 17-Apr-2012 |
Jason Evans <[email protected]> |
Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch, prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib
Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch, prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib/libc/stdlib/malloc.c in March 2010, which means that a portion of the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries for all subsequent releases.
show more ...
|
|
Revision tags: release/8.3.0 |
|
| #
9e16bab4 |
| 09-Jan-2012 |
Ed Schouten <[email protected]> |
Add aligned_alloc(3).
The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by
Add aligned_alloc(3).
The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by reference, it returns the address, just like malloc(3).
Reviewed by: jasone@
show more ...
|
| #
75c73b66 |
| 08-Jan-2012 |
Ed Schouten <[email protected]> |
Properly sort functions by name.
|
| #
0a31efe0 |
| 07-Dec-2011 |
David Chisnall <[email protected]> |
Implement quick_exit() / at_quick_exit() from C++11 / C1x. Also add a __noreturn macro and modify the other exiting functions to use it.
The __noreturn macro, unlike __dead2, must be used BEFORE th
Implement quick_exit() / at_quick_exit() from C++11 / C1x. Also add a __noreturn macro and modify the other exiting functions to use it.
The __noreturn macro, unlike __dead2, must be used BEFORE the function. This is in line with the C and C++ specifications that place _Noreturn (c1x) and [[noreturn]] (C++11) in front of the functions. As with __dead2, this macro falls back to using the GCC attribute.
Unfortunately, clang currently sets the same value for the C version macro in C99 and C1x modes, so these functions are hidden by default. At some point before 10.0, I need to go through the headers and clean up the C1x / C++11 visibility.
Reviewed by: brooks (mentor)
show more ...
|
| #
3c87aa1d |
| 20-Nov-2011 |
David Chisnall <[email protected]> |
Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit
Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation.
Please test any code you have that uses the C standard locale functions!
Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
show more ...
|
|
Revision tags: release/7.4.0, release/8.2.0, release/8.1.0, release/7.3.0, release/8.0.0, release/7.2.0, release/7.1.0, release/6.4.0 |
|
| #
d6742bfb |
| 27-Aug-2008 |
Jason Evans <[email protected]> |
Add thread-specific caching for small size classes, based on magazines. This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased me
Add thread-specific caching for small size classes, based on magazines. This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased memory use and fragmentation.
Reduce the default number of arenas to 2*ncpus, since thread-specific caching typically reduces arena contention.
Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced, cacheline-spaced, and subpage-spaced size classes. The advantages are: fewer size classes, reduced false cacheline sharing, and reduced internal fragmentation for allocations that are slightly over 512, 1024, etc.
Increase RUN_MAX_SMALL, in order to limit fragmentation for the subpage-spaced size classes.
Add a size-->bin lookup table for small sizes to simplify translating sizes to size classes. Include a hard-coded constant table that is used unless custom size class spacing is specified at run time.
Add the ability to disable tiny size classes at compile time via MALLOC_TINY.
show more ...
|
| #
bc093719 |
| 20-Aug-2008 |
Ed Schouten <[email protected]> |
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers.
If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
show more ...
|
| #
e3580e9d |
| 17-Jun-2008 |
Ed Schouten <[email protected]> |
Don't export the unused __use_pts() routine.
The __use_pts() routine was once probably used by libutil to determine if we are using BSD or UNIX98 style PTY device names. It doesn't seem to be used o
Don't export the unused __use_pts() routine.
The __use_pts() routine was once probably used by libutil to determine if we are using BSD or UNIX98 style PTY device names. It doesn't seem to be used outside grantpt.c, which means we can make it static and remove it from the Symbol.map.
Reviewed by: cognet, kib Approved by: philip (mentor)
show more ...
|
|
Revision tags: release/7.0.0, release/6.3.0 |
|
| #
959496ef |
| 22-May-2007 |
Jonathan Chen <[email protected]> |
Backout 1.5 as requested by deischen
|
| #
81d83047 |
| 22-May-2007 |
Jonathan Chen <[email protected]> |
__cleanup() is needed for ports/devel/valgrind, export it.
|
| #
5f864214 |
| 29-Apr-2007 |
Daniel Eischen <[email protected]> |
Use C comments since we now preprocess these files with CPP.
|
|
Revision tags: release/6.2.0, release/5.5.0, release/6.1.0 |
|
| #
6b2c15da |
| 28-Mar-2006 |
Jason Evans <[email protected]> |
Add malloc_usable_size(3).
Discussed with: arch@
|
| #
c74dfa2f |
| 14-Mar-2006 |
Andre Oppermann <[email protected]> |
Import of OpenBSD's strtonum(3) which is a nicer version of strtoll(3) providing proper error checking and other improvements.
Obtained from: OpenBSD Requested by: flz (to port Open[BGP|OSPF]D) MFC
Import of OpenBSD's strtonum(3) which is a nicer version of strtoll(3) providing proper error checking and other improvements.
Obtained from: OpenBSD Requested by: flz (to port Open[BGP|OSPF]D) MFC after: 3 days
show more ...
|
| #
cce72e88 |
| 13-Mar-2006 |
Daniel Eischen <[email protected]> |
Add symbol maps and initial symbol version definitions to libc.
Reviewed by: davidxu
|