| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
problems in cases where regions are faked up for the purposes of red-black
tree searches, since those faked region headers reside on the stack, rather
than in a malloc chunk.
|
| |
|
|
|
|
|
| |
internal allocation does not rely on recursive arena use (base_arena was
removed in revision 1.95).
|
|
|
|
| |
Reported by: ache
|
|
|
|
|
|
|
|
| |
allowing the error to be fatal.
Move a label in order to make sure to properly handle errors in malloc(0).
Reported by: Alastair D'Silva, Saneto Takanori
|
|
|
|
|
|
|
|
|
|
| |
there is never any need to recursively call the main allocation functions.
Remove recursive spinlock support, since it is no longer needed.
Allow chunks to be as small as the page size.
Correctly propagate OOM errors from arena_new().
|
|
|
|
|
|
|
|
|
| |
broken for non-threaded shared processes in that __tls_get_addr()
assumes the thread pointer is always initialized. This is not the
case. When arenas_map is referenced in choose_arena() and it is
defined as a thread-local variable, it will result in a SIGSEGV.
PR: ia64/91846 (describes the TLS/ia64 bug).
|
|
|
|
|
|
|
| |
a scalable concurrent allocator implementation.
Reviewed by: current@
Approved by: phk, markm (mentor)
|
|
|
|
| |
Reported by: glebius
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
|
|
|
| |
surrounding the undef'ing it. It does not seem necessary to
undef some symbol that is not exist, and gcc does not complain
about whether a symbol is exist before #undef'ing it out.
Spotted by: mingyanguo via ChinaUnix.net forum
Reviewed by: phk
|
|
|
|
| |
in <sys/cdefs.h> for compilers without support for inline.
|
| |
|
|
|
|
|
|
| |
done before the first call, even if this is a malloc(0) call.
PR: 62859
|
|
|
|
|
|
|
|
|
|
| |
through a realloc like function.
Make the malloc_active variable a local static to this new function.
Don't warn about recursion more than once per base call.
constify malloc_func.
|
|
|
|
|
|
|
|
|
| |
has been hit, this makes it cover more cases.
Call the message function directly rather than fiddle with flag-saving
when we find an unknown character in our options.
The 'A' flag should not trigger on legal out of memory conditions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
lacking the issetugid() and utrace() syscalls.
|
| |
|
| |
|
|
|
|
| |
Pull 'A' evilness for realloc(3) from OpenBSD.
|
| |
|
| |
|
|
|
|
| |
Submitted by: Nadav Eiron <nadav@TheEirons.org>
|
| |
|
|
|
|
| |
result in a segfault. Instead just return NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Persuaded by: Google
|
|
|
|
| |
Spotted by: ache
|
|
|
|
| |
Partially submitted by: wollman
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
I believe have made all of libc .c's as consistent as possible.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
PR: 29376
Submitted by: Farooq Mela <fmela0@sm.socccd.cc.ca.us>
|
|
|
|
| |
Pointed out by: knu
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Noticed by: bde
|
|
|
|
| |
Submitted by: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Use _PATH_* where where possible.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Pointed out by: phk
|
|
|
|
|
|
| |
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*
|
|
|
|
|
|
|
|
| |
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.
|