summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/libc_private.h
Commit message (Collapse)AuthorAgeFilesLines
* Add thread-specific caching for small size classes, based on magazines.jasone2008-08-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Turn execvpe() into an internal libc routine.ed2008-06-231-0/+3
| | | | | | | | | | | | Adding exevpe() has caused some ports to break. Even though execvpe() is a useful routine, it does not conform to any standards. This patch is a little bit different from the patch sent to the mailing list. I forgot to remove execvpe from the Symbol.map (which does not seem to miscompile libc, though). Reviewed by: davidxu Approved by: philip
* Add some compatibility code so that software which is built to use the newdfr2008-04-041-0/+3
| | | | | | | struct flock with l_sysid member can work properly on an an old kernel which doesn't support l_sysid. Sponsored by: Isilon Systems
* Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate topeter2007-07-041-0/+23
| | | | | | | | | call the pad-less versions of the corresponding syscalls if the running kernel supports it. Check kern.osreldate once per program and cache the result to select the appropriate syscall. This maintains userland compatability with kernel.old's from quite a while back. Approved by: re (kensmith)
* Remove 3rd clause, renumber, ok per emailimp2007-01-121-4/+1
|
* Add some more pthread stubs so that librt can use them.deischen2006-03-051-3/+34
| | | | | | | The thread jump table has been resorted, so you need to keep libc, libpthread, and libthr in sync. Submitted by: xu
* In preparation for a new malloc implementation:jasone2006-01-121-3/+4
| | | | | | | | | | | | | * Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor)
* Move the declaration of __cleanup to libc_private.h as it is used in bothstefanf2005-09-121-0/+5
| | | | stdio/ and stdlib/. Don't define __cleanup twice.
* Add support for TLS in statically linked programs.dfr2004-08-151-0/+9
|
* Remove #include of spinlock.h from libc_private.h. Declare spinlocks asdeischen2003-11-051-3/+1
| | | | | | | struct _spinlock. Keep the typedef in for now; another set of changes may come around to clean up consumers of spinlocks. Requested by: bde
* Externalize malloc's spinlock so that a thread library can takedeischen2003-11-041-0/+8
| | | | | | | | | | | it around an application's fork() call. Our new thread libraries (libthr, libpthread) can now have threads running while another thread calls fork(). In this case, it is possible for malloc to be left in an inconsistent state in the child. Our thread libraries, libpthread in particular, need to use malloc internally after a fork (in the child). Reviewed by: davidxu
* Eliminate 19 warnings in libc (at level WARNS=2) of thenectar2003-02-271-0/+8
| | | | `implicit declaration of function' variety.
* Argh, change declaration of two-dimensional array so that it actuallydeischen2002-11-131-1/+2
| | | | builds.
* Make this compile with whatever error-checking is enabled in buildworlddeischen2002-11-131-2/+2
| | | | and/or beast.
* Use a jump table (a la Solaris) for pthread routines with defaultdeischen2002-11-131-0/+42
| | | | | | | | | | entries in the table being stubs. While I'm here, add macros to auto-generate the stubs. A conforming threads library can override the stub routines by filling in the jump table. Add some entries to namespace.h and sync un-namespace.h to it. Also add a comment to remind folks to update un-namespace.h when changing namespace.h.
* Do not use __progname directly (except in [gs]etprogname(3)).markm2002-03-291-0/+6
| | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland.
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Remove leading underscores from the FILE lock functions that POSIXjb1998-05-051-3/+3
| | | | specifies.
* Add a private header file for libc/libc_r/libpthread to containjb1998-04-111-0/+66
definitions for things like locking etc.
OpenPOWER on IntegriCloud