| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialization overhead, there's a problem in that we never call
imalloc() and thus malloc_init() for zero-sized allocations. As a
result, malloc(0) returns NULL when it's the first or only malloc in
the program. Any non-zero allocation will initialize the malloc code
with the side-effect that subsequent zero-sized allocations return a
non-NULL pointer. This is because the pointer we return for zero-
sized allocations is calculated from malloc_pageshift, which needs
to be initialized at runtime on ia64.
The result of the inconsistent behaviour described above is that
configure scripts failed the test for a GNU compatible malloc. This
resulted in a lot of broken ports.
Other, even simpler, solutions were possible as well:
1. initialize malloc_pageshift with some non-zero value (say 13 for
8KB pages) and keep the runtime adjustment.
2. Stop using malloc_pageshift to calculate ZEROSIZEPTR.
Removal of the runtime adjustment was chosen because then ia64 is the
same as any other platform. It is not to say that using a page size
obtained at runtime is bad per se. It's that there's currently a high
level of gratuity for its existence and the moment it causes problems
is the moment you need to get rid of it. Hence, it's not unthinkable
that this commit is (partially) reverted some time in the future when
we do have a good reason for it and a good way to achieve it.
Approved by: re@ (rwatson)
Reported by: kris (portmgr@) -- may the ports be with you
Notes:
svn path=/head/; revision=123031
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=122069
|
| |
|
|
|
|
|
| |
lacking the issetugid() and utrace() syscalls.
Notes:
svn path=/head/; revision=121667
|
| |
|
|
| |
Notes:
svn path=/head/; revision=121518
|
| |
|
|
| |
Notes:
svn path=/head/; revision=121500
|
| |
|
|
|
|
|
| |
Pull 'A' evilness for realloc(3) from OpenBSD.
Notes:
svn path=/head/; revision=120524
|
| |
|
|
| |
Notes:
svn path=/head/; revision=120520
|
| |
|
|
| |
Notes:
svn path=/head/; revision=118153
|
| |
|
|
|
|
|
| |
Submitted by: Nadav Eiron <nadav@TheEirons.org>
Notes:
svn path=/head/; revision=115610
|
| |
|
|
| |
Notes:
svn path=/head/; revision=114321
|
| |
|
|
|
|
|
| |
result in a segfault. Instead just return NULL.
Notes:
svn path=/head/; revision=110103
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to be called on first sight of trouble.
"sensitive" is somewhat arbitrarily defined as "setuid, setgid, uid == root
or gid == wheel".
The 'A' option carries no performance penalty.
It is not possible to override this setting: fix the program instead.
Absentmindedly nodded OK to by: various
Notes:
svn path=/head/; revision=109754
|
| |
|
|
|
|
|
| |
Persuaded by: Google
Notes:
svn path=/head/; revision=102229
|
| |
|
|
|
|
|
| |
Spotted by: ache
Notes:
svn path=/head/; revision=101568
|
| |
|
|
|
|
|
| |
Partially submitted by: wollman
Notes:
svn path=/head/; revision=97639
|
| |
|
|
| |
Notes:
svn path=/head/; revision=96350
|
| |
|
|
| |
Notes:
svn path=/head/; revision=95377
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=93399
|
| |
|
|
|
|
|
| |
I believe have made all of libc .c's as consistent as possible.
Notes:
svn path=/head/; revision=92986
|
| |
|
|
| |
Notes:
svn path=/head/; revision=92905
|
| |
|
|
| |
Notes:
svn path=/head/; revision=92889
|
| |
|
|
| |
Notes:
svn path=/head/; revision=91161
|
| |
|
|
|
|
|
|
| |
PR: 29376
Submitted by: Farooq Mela <fmela0@sm.socccd.cc.ca.us>
Notes:
svn path=/head/; revision=86488
|
| |
|
|
|
|
|
| |
Pointed out by: knu
Notes:
svn path=/head/; revision=86466
|
| |
|
|
|
|
|
|
|
|
|
| |
If zero bytes are allocated, return pointer to the middle of page-zero
(which is protected) so that the program will crash if it dereferences
this illgotten pointer.
Inspired & Urged by: Theo de Raadt <deraadt@cvs.openbsd.org>
Notes:
svn path=/head/; revision=85869
|
| |
|
|
| |
Notes:
svn path=/head/; revision=83202
|
| |
|
|
|
|
|
| |
Noticed by: bde
Notes:
svn path=/head/; revision=81447
|
| |
|
|
|
|
|
| |
Submitted by: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
Notes:
svn path=/head/; revision=71987
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=71579
|
| |
|
|
|
|
|
| |
Use _PATH_* where where possible.
Notes:
svn path=/head/; revision=69793
|
| |
|
|
|
|
|
|
|
|
| |
stderr in case of warnings and errors.
Rename malloc_options to have a leading underscore, I belive I have been
told that is more correct namespace wise.
Notes:
svn path=/head/; revision=69201
|
| |
|
|
|
|
|
| |
Pointed out by: phk
Notes:
svn path=/head/; revision=66105
|
| |
|
|
|
|
|
|
|
| |
The recent problems with sshd were due to sshd reassigning
`environ' when setenv() thinks it owns it. setenv() subsequently
realloc()s the new version of environ and *boom*
Notes:
svn path=/head/; revision=66101
|
| |
|
|
|
|
|
|
|
|
|
| |
These will be turned off again as we approach 5.0-RELEASE.
If you benchmark things, make sure to
ln -sf j /etc/malloc.conf
to see "true" performance.
Notes:
svn path=/head/; revision=62847
|
| |
|
|
|
|
|
|
|
|
| |
<netch@segfault.kiev.ua>
Remove allocation failure check from 'A' option, the 'X' option does
this as a standalone check now.
Notes:
svn path=/head/; revision=59117
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().
Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().
Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().
Make thread cancellation fully POSIX-compliant.
Suggested by: deischen
Notes:
svn path=/head/; revision=56698
|
| |
|
|
|
|
|
|
|
| |
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().
Notes:
svn path=/head/; revision=55837
|
| |
|
|
| |
Notes:
svn path=/head/; revision=50476
|
| |
|
|
| |
Notes:
svn path=/head/; revision=48672
|
| |
|
|
|
|
|
| |
Approved by: phk
Notes:
svn path=/head/; revision=48670
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
changes have made this too expensive. This gains about 1.25% on
worldstone on my SMP machine.
Swap-less machines, for instance PicoBSDs, and machines which experience
page-out trafic, check with top(1), will probably want to reenable this
with:
ln -s H /etc/malloc.conf
Suggested by: alc (&dyson ?)
Notes:
svn path=/head/; revision=45091
|
| |
|
|
|
|
|
|
|
|
|
|
| |
realloc functions check for recursion within the malloc code itself. In
a thread-safe library, the single spinlock ensures that no two threads
go inside the protected code at the same time. The thread implementation
is responsible for ensuring that the spinlock does in fact protect malloc.
There was a window of opportunity in which this was not the case. I'll fix
that with a commit RSN.
Notes:
svn path=/head/; revision=39802
|
| |
|
|
| |
Notes:
svn path=/head/; revision=39606
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our spinlock implementation allows a particular thread to obtain a lock
multiple times, but release the lock with a single unlock call. Since
we're detecting recursion, we know the lock is already owned by the
current thread in a previous call and must not be released in the
current call. This is really far too dependent on this particular
spinlock implementation, so I've added commented out calls to
THREAD_UNLOCK in the appropriate places. We can activate this code when
spinlock is taught to count each lock operation.
Notes:
svn path=/head/; revision=39501
|
| |
|
|
|
|
|
|
|
| |
Set malloc_func *after* grabbing the thread lock.
Noticed by: Simon Coggins <simon@oz.org>
Notes:
svn path=/head/; revision=39491
|
| |
|
|
|
|
|
| |
errno during a successful malloc() call.
Notes:
svn path=/head/; revision=37048
|
| |
|
|
| |
Notes:
svn path=/head/; revision=36804
|
| |
|
|
|
|
|
|
|
|
| |
and non-threaded programs. This makes malloc thread safe for linking
with libpthread and kernel threads.
Reviewed by: phk
Notes:
svn path=/head/; revision=35503
|
| |
|
|
| |
Notes:
svn path=/head/; revision=35026
|
| |
|
|
|
|
|
| |
__NETBSD_SYSCALLS is defined.
Notes:
svn path=/head/; revision=34382
|