summaryrefslogtreecommitdiffstats
path: root/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* Richard Sandiford writes:Mike Frysinger2007-01-292-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | However, retesting on m68k showed up a problem that had appeared in uClibc since the last time I tried. Specifically, revision 15785 did: -#define HEAP_GRANULARITY (sizeof (HEAP_GRANULARITY_TYPE)) +#define HEAP_GRANULARITY (__alignof__ (HEAP_GRANULARITY_TYPE)) -#define MALLOC_ALIGNMENT (sizeof (double)) +#define MALLOC_ALIGNMENT (__alignof__ (double)) The problem is that (a) MALLOC_HEADER_SIZE == MALLOC_ALIGNMENT (b) the header contains a size value of type size_t (c) sizeof (size_t) is 4 on m68k, but... (d) __alignof__ (double) is only 2 (the largest alignment used on m68k) So we only allocate 2 bytes for the 4-byte header, and the least significant 2 bytes of the size are in the user's area rather than the header. The patch below fixes that problem by redefining MALLOC_HEADER_SIZE to: MAX (MALLOC_ALIGNMENT, sizeof (size_t)) (but without the help of the MAX macro ;)). However, we really would like to have word alignment on Coldfire. It makes a big performance difference, and because we have to allocate a 4-byte header anyway, what wastage there is will be confined to the end of the allocated block. Any wastage will also be limited to 2 bytes per allocation compared to the current alignment. I've therefore used the __aligned__ type attribute to create a double type that has at least sizeof (size_t) bytes of alignment. I've introduced a new __attribute_aligned__ macro for this. It might seem silly protecting against old or non-GNU compilers here, but the extra alignment is only an optimisation, and having the macro is more in the spirit of the other attribute code.
* fix from Bryan Wu: return NULL upon error, not the NULL stringMike Frysinger2007-01-241-4/+3
|
* rename local "brk" var so it doesnt namespace collide with the brk() functionMike Frysinger2006-12-171-18/+18
|
* mostly revert the locking changes for 'malloc', as the implementationEric Andersen2006-12-112-8/+10
| | | | | | | | does not easily lend itself to becoming complete pthread cancelation safe without first investing in some deep and serious thought... The other malloc implementations are pthread cancelation safe, and this one is mostly used for uClinux, where the lack is at least less likely to be a common problem.
* Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen2006-12-072-8/+8
| | | | | | | things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking.
* Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen2006-12-0713-229/+237
| | | | | | | things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking.
* - Cleanout the only occurance of the SUSv3 LEGACY function getwd() that wasBernhard Reutner-Fischer2006-11-291-6/+1
| | | | furthermore ifdef'ed out anyway.
* - gcvt() is marked LEGACY in XSI and mandatory in BSD.Bernhard Reutner-Fischer2006-11-291-1/+4
| | | | Also make compilation conditional on float support.
* fix from psm: makes use of the malloc debug option in malloc-standard as wellMike Frysinger2006-08-253-12/+7
|
* merge fix from blackfin cvs:Mike Frysinger2006-08-052-2/+2
| | | | bernds writes: Use __alignof__ instead of sizeof to get alignments. Eliminates some warnings about misalignments when malloc debugging is enabled.
* fixup my copyright notice, trim stale remnants of older notices whichEric Andersen2006-07-052-2/+0
| | | | I had clearly run search/replace on that were cluttering things up.
* fixup my copyright notice, trim stale remnants of older notices whichEric Andersen2006-07-052-40/+12
| | | | I had clearly run search/replace on that were cluttering things up.
* Mark some functions as BSD onlyPeter S. Mazinger2006-03-231-0/+2
|
* Correct build if UCLIBC_HAS_CTYPE_TABLES is not definedPeter S. Mazinger2006-03-222-3/+3
|
* Mark some functions as GNU, provide missing hidden memmem, remove ↵Peter S. Mazinger2006-03-221-1/+0
| | | | _ISOC99/XOPEN_SOURCE
* Fix 'realloc' and revert previous changes to tests. malloc tests all pass ↵"Steven J. Hill"2006-03-171-1/+1
| | | | regardless of the setting of MALLOC_GLIBC_COMPAT.
* Remove all non-constant libc_hidden_data_def(), it is too unreliable, sorry, ↵Peter S. Mazinger2006-03-109-14/+0
| | | | most of global data relocations are back
* Do not use __XL_NPP macroPeter S. Mazinger2006-02-241-4/+20
|
* guard __ignore_x correctly, move undefs to their proper place, add ↵Peter S. Mazinger2006-02-241-27/+52
| | | | prototypes. Should I do all the other *max aliases as well
* exclude 2 files from multi if XLOCALE enabledPeter S. Mazinger2006-02-221-0/+1
|
* check for a 0 size first, then check for a NULL pointerMike Frysinger2006-02-221-2/+2
|
* sync minor touchups with glibcMike Frysinger2006-02-203-11/+13
|
* tweak the idea between having a MMU and actually using itMike Frysinger2006-02-184-4/+4
|
* DOMULTI may be used for libc, the excluded files need work, ↵Peter S. Mazinger2006-02-151-1/+3
| | | | linuxthreads[_db] as well, don't try on slow box
* Reorganize a bit for IMAPeter S. Mazinger2006-02-151-12/+8
|
* after much deliberation, may i present Joseph S. Myers patch to add support ↵Mike Frysinger2006-02-141-11/+3
| | | | | | | | for .init and .fini array processing for the gory details, see the mailing list: http://www.uclibc.org/lists/uclibc/2006-January/014079.html http://www.uclibc.org/lists/uclibc/2006-February/014285.html
* libc-{a,so,multi}-y replaced by libc-y covering common objects both in ↵Peter S. Mazinger2006-02-134-156/+79
| | | | libc.a/libc.so, the diffs go into libc-static-y/libc-shared-y exclusively, add IMA to libc, don't use any MSRC anymore
* Update some copyrightsPeter S. Mazinger2006-02-131-2/+4
|
* Add files for IMA. Yes, I know it's a hack and no, I won't split the ↵Peter S. Mazinger2006-02-1368-0/+525
| | | | affected files
* Remove unused filesPeter S. Mazinger2006-02-132-68/+0
|
* More renames for IMAPeter S. Mazinger2006-02-133-2/+2
|
* Don't compile arc4random if option not setPeter S. Mazinger2006-02-132-5/+4
|
* just drop all of the debug codeMike Frysinger2006-02-091-2/+1
|
* Bernhard Fischer says: get rid of local ret variableMike Frysinger2006-02-081-3/+1
|
* janlana writes in Bug 700: use standard uint* types rather than u_intMike Frysinger2006-02-081-15/+15
|
* Go __malloc_lock, go ...Peter S. Mazinger2006-02-012-0/+2
|
* global data uses libc_hidden_data_def, convert all -I hope- and add some newPeter S. Mazinger2006-02-011-0/+2
|
* rename local var brk to _brkMike Frysinger2006-01-311-6/+6
|
* Why this?Peter S. Mazinger2006-01-301-1/+1
|
* Patch by Joseph S. Myers to add support for ARM EABIMike Frysinger2006-01-291-0/+2
|
* declare local prototype since we cant use system malloc.hMike Frysinger2006-01-291-0/+1
|
* Do not build *64 and llseek, correct some failure when LFS is disabledPeter S. Mazinger2006-01-271-1/+4
|
* Some warnings go awayPeter S. Mazinger2006-01-271-4/+4
|
* Get rid of missing prototype warningsPeter S. Mazinger2006-01-265-5/+12
|
* Convert all the strong_aliases to weak that are cancelable in libpthreadPeter S. Mazinger2006-01-241-1/+1
|
* Make i386 build w/ -std=c99 (almost)Peter S. Mazinger2006-01-231-1/+1
|
* Enable _GNU_SOURCE build wide, trying to get consistent interfaces, else IMA ↵Peter S. Mazinger2006-01-2212-12/+0
| | | | is a useless attempt
* fix building/warnings on 64bit archesMike Frysinger2006-01-201-2/+6
|
* Correction if UNIX98PTY_ONLY is not enabledPeter S. Mazinger2006-01-202-5/+8
|
* move a bunch of arch-specific checks out of common files and into an arch ↵Mike Frysinger2006-01-191-32/+4
| | | | specific header file to make porting/updates a lot easier