summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
...
* Include mergesort() in description of errors.rnordier1998-11-041-1/+3
|
* Drop unused labels.rnordier1998-11-041-2/+2
|
* Handle a zero elements argument.rnordier1998-11-041-0/+3
| | | | | PR: 8566 Submitted by: Archie Cobbs <archie@whistle.com>
* Delete the XXX comments that refer to spinlock recursion. The malloc/free/jb1998-09-301-15/+1
| | | | | | | | | 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.
* Use 8k pagesize on alpha, not 4k.dfr1998-09-231-1/+5
|
* Back out part of previous commit (even though it's technically correct).alex1998-09-201-1/+17
| | | | | | | | | | | 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.
* Correctly back out of free if a recursive call into malloc.c is detected.alex1998-09-191-8/+7
| | | | | | Set malloc_func *after* grabbing the thread lock. Noticed by: Simon Coggins <simon@oz.org>
* Replace memory leaking instances of realloc with non-leaking reallocf.imp1998-09-162-2/+2
| | | | | | | | | | | In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
* o Don't reference non-existant function freealloc.imp1998-09-161-4/+4
| | | | | | o Properly order things Pointed out by: bde
* Fix style problems noted by Bruce:imp1998-09-162-8/+35
| | | | | | o No copyright on reallocf. o Order makefile list correctly. o indent reallocf properly.
* Add reallocf to the library. This function is simliar to realloc, butimp1998-09-143-13/+42
| | | | | | | | | | | | | when it returns NULL to indicate failure, it will also free the memory that was passed to it, if that was non-null. This does not change the semantics of realloc. A second commit will be done to commit the conversion of those places in the code that can safely use this to avoid memory leaks when confronted with low memory situations. Beaten-to-death-but-finally-approved-in: -current
* preserve errno across the readlink() calls. There is no value in trashingpeter1998-06-181-1/+4
| | | | errno during a successful malloc() call.
* Add support for thread lock debug. No impact of the malloc code.jb1998-06-091-4/+4
|
* This is a hack to workaround source that is coded to use long variablesjb1998-05-082-2/+2528
| | | | | | | | | | but also assumes that they are 32-bits. This is one place where I don't think it is appropriate to change 'long' to 'int'. I don't see why the code couldn't be fixed so that using natural long variables does the right thing. It's spaggetti code so it'll take some effort. Obviously NetBSD thought so too because they change 'long' to 'int32_t' etc and left it at that. As a temporary measure FreeBSD/Alpha can use the NetBSD code and put this on the list of things to fix.
* Fix a few nits in quoted code fragments and elsewhere.rnordier1998-05-041-5/+4
|
* Replace the threaded locking with spinlock calls for both threadedjb1998-04-291-18/+10
| | | | | | | and non-threaded programs. This makes malloc thread safe for linking with libpthread and kernel threads. Reviewed by: phk
* Reference an external variable in threaded programs so that thejb1998-04-291-0/+6
| | | | autoinitialiser gets linked in and therefore called before main().
* Use signal() in both the threaded and non-threaded cases.jb1998-04-291-2/+1
|
* indentdima1998-04-201-1/+1
|
* Remove a nolonger implented "BUGS" description.phk1998-04-111-14/+0
| | | | | | PR: 6240 Reviewed by: phk Submitted by: Niall Smart rotel@indigo.ie
* Add a global variable called __isthreaded that can be tested throughoutjb1998-04-111-0/+9
| | | | | | | | libc to determine if locking is required. This is needed in libc for use with kernel threads, but until a thread is created, we don't really want to bother locking things. The variable was added here because the crt code calls exit(main()) so all programs will get the variable.
* Change in name of the static initializer define.jb1998-04-041-2/+2
|
* .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aqcharnier1998-03-192-3/+4
|
* NetBSD doesn't have a utrace syscall, so don't define that ifjb1998-03-091-2/+4
| | | | __NETBSD_SYSCALLS is defined.
* Change MACHINE references to MACHINE_ARCH.jb1998-02-201-3/+3
|
* Drop the use of caddr_t in conjunction with mmap(2).alex1997-12-311-4/+4
|
* Fix recursion problem which occurs when a signal is received duringjb1997-12-151-3/+12
| | | | | | | a malloc. The signal handler creates a thread which requires a malloc... For now, the only thing to do is to block signals. When we move user pthreads to use the kernel threads, mutexes will be implemented in kernel space and then malloc can revert.
* Sorted lists.bde1997-10-211-6/+6
|
* Handle machine-dependent (stdlib) sources more automatically.bde1997-10-161-2/+2
| | | | | | | This fixes bugs in the manual handling. abs.[cS] was handled too specially and the wrong (.c) variant for each of div.[cS], labs.[cS] and ldiv.[cS] was added to SRCS. This caused the .c variant to be used if `depend' was made and the .S version to be used otherwise.
* Removed the subdirectory paths from the definitions of MAN[1-9]. Theybde1997-10-151-10/+5
| | | | | were a workaround for limitations in bsd.man.mk that were fixed about 2 years ago.
* environmental -> environment.charnier1997-09-181-2/+2
|
* Another 32bits of 64bits conformance.phk1997-08-311-2/+2
| | | | | Reviewed by: phk Submitted by: jdp
* Improvement of type independency for the bitmap.phk1997-08-271-3/+4
| | | | | | | This makes 64bit operation more likely. Reviewed by: phk Submitted by: jdp
* Malloc option H is now default.phk1997-08-272-4/+5
|
* Get rid of integer overflow warning.steve1997-08-232-2/+2
| | | | | PR: misc/3575 Submitted by: Bruce Evans <bde@zeta.org.au>
* Fix a minor typo. It only affects the sparc version.jdp1997-07-261-2/+2
|
* realpath() should break on looped symlinks.phk1997-07-161-0/+5
| | | | | | PR: 3911 Reviewed by: phk Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
* kill the undeadpeter1997-07-132-180/+0
|
* This commit was generated by cvs2svn to compensate for changes in r27180,bde1997-07-032-0/+180
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Import Lite2's src/lib, except for non-i386 machine-dependent directories,bde1997-07-032-0/+180
| | | | | | | | | | libc/db, libc/gen/crypt.* and libtelnet. All affected files except 3 unimportant ones have already left the vendor branch.
* | Have another go at the malloc-sysv initialization.phk1997-07-021-12/+11
| | | | | | | | | | PR: 4002 Pointed out by: bde
* | malloc_sysv used before initialized, reported in PR4002 byphk1997-07-014-40/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> Various cleanup from Keith Bostic Reinstate calloc() as a separate funtion, in its own source/object file. leave the manpage integrated with malloc.3 and friends. Too many things were broken in this respect. PR: 4002 Reviewed by: phk Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> Submitted by: Keith Bostic <bostic@bostic.com>
* | Show the real revision date and not the date that thissteve1997-06-231-1/+1
| | | | | | | | manpage is being viewed.
* | Integrate calloc with the rest of the gang.phk1997-06-225-478/+390
| | | | | | | | | | | | | | | | | | | | | | Various portability and stylistic cleanups. Kill MALLOC_STATS & the 'D' option. Fix the 'V' option. Major overhaul of the man-page. You milage should not vary. Reviewed by: Keith Bostic <bostic@bostic.com> Submitted by: Keith Bostic <bostic@bostic.com>
* | srandomdev: use stack junk value in the fallback code tooache1997-06-151-2/+3
| |
* | Instead of copying fallback code over and over in each program,ache1997-06-142-15/+17
| | | | | | | | | | | | implement (better) falback code inside srandomdev() itself. Change return type from int to void (binary compatibility surprisely achieved). Userland code will be changed soon.
* | Add yet an option, this time on how to deal with malloc(0) and realloc(ptr.0)phk1997-06-122-8/+27
| | | | | | | | Prompted by: X11 & XFree86
* | Fix mutex initialization.jb1997-06-041-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Malloc cannot use pthread_mutex_init() to initialize a mutex because the mutex initialization process does a malloc! libc_r internals skip the malloc and assign an initializer to a static structure and point the opaque type (pthread_mutex_t in this case) to that structure. This is done on the assumption that the mutex will never be destroyed. This style of initialization is only valid inside libc_r because the structure that is assigned is opaque to the user. This fix allows a simple program to get to main() again. 8-)
* | Malloc flag X makes malloc behave like the canonical xmalloc() wrapper.phk1997-05-302-19/+69
| | | | | | | | | | | | | | Untested support for Solaris from John-Mark Gurney Reviewed by: phk Submitted by: (partially) John-Mark Gurney <gurney_j@resnet.uoregon.edu>
* | Changed all paths to be relative to src/lib instead of src/lib/libcjb1997-05-031-3/+7
| | | | | | | | | | | | | | | | | | | | so that all these makefiles can be used to build libc_r too. Added .if ${LIB} == "c" tests to restrict man page builds to libc to avoid needlessly building them with libc_r too. Split libc Makefile into Makefile and Makefile.inc to allow the libc_r Makefile to include Makefile.inc too.
OpenPOWER on IntegriCloud