summaryrefslogtreecommitdiff
path: root/libc/stdlib
AgeCommit message (Collapse)Author
2007-02-08handle file_name==NULL and file_name=="" as required by POSIXMike Frysinger
2007-01-29Richard Sandiford writes:Mike Frysinger
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.
2007-01-24fix from Bryan Wu: return NULL upon error, not the NULL stringMike Frysinger
2006-12-17rename local "brk" var so it doesnt namespace collide with the brk() functionMike Frysinger
2006-12-11mostly revert the locking changes for 'malloc', as the implementationEric Andersen
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.
2006-12-07Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen
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.
2006-12-07Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen
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.
2006-11-29- Cleanout the only occurance of the SUSv3 LEGACY function getwd() that wasBernhard Reutner-Fischer
furthermore ifdef'ed out anyway.
2006-11-29- gcvt() is marked LEGACY in XSI and mandatory in BSD.Bernhard Reutner-Fischer
Also make compilation conditional on float support.
2006-08-25fix from psm: makes use of the malloc debug option in malloc-standard as wellMike Frysinger
2006-08-05merge fix from blackfin cvs:Mike Frysinger
bernds writes: Use __alignof__ instead of sizeof to get alignments. Eliminates some warnings about misalignments when malloc debugging is enabled.
2006-07-05fixup my copyright notice, trim stale remnants of older notices whichEric Andersen
I had clearly run search/replace on that were cluttering things up.
2006-07-05fixup my copyright notice, trim stale remnants of older notices whichEric Andersen
I had clearly run search/replace on that were cluttering things up.
2006-03-23Mark some functions as BSD onlyPeter S. Mazinger
2006-03-22Correct build if UCLIBC_HAS_CTYPE_TABLES is not definedPeter S. Mazinger
2006-03-22Mark some functions as GNU, provide missing hidden memmem, remove ↵Peter S. Mazinger
_ISOC99/XOPEN_SOURCE
2006-03-17Fix 'realloc' and revert previous changes to tests. malloc tests all pass ↵"Steven J. Hill"
regardless of the setting of MALLOC_GLIBC_COMPAT.
2006-03-10Remove all non-constant libc_hidden_data_def(), it is too unreliable, sorry, ↵Peter S. Mazinger
most of global data relocations are back
2006-02-24Do not use __XL_NPP macroPeter S. Mazinger
2006-02-24guard __ignore_x correctly, move undefs to their proper place, add ↵Peter S. Mazinger
prototypes. Should I do all the other *max aliases as well
2006-02-22exclude 2 files from multi if XLOCALE enabledPeter S. Mazinger
2006-02-22check for a 0 size first, then check for a NULL pointerMike Frysinger
2006-02-20sync minor touchups with glibcMike Frysinger
2006-02-18tweak the idea between having a MMU and actually using itMike Frysinger
2006-02-15DOMULTI may be used for libc, the excluded files need work, ↵Peter S. Mazinger
linuxthreads[_db] as well, don't try on slow box
2006-02-15Reorganize a bit for IMAPeter S. Mazinger
2006-02-14after much deliberation, may i present Joseph S. Myers patch to add support ↵Mike Frysinger
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
2006-02-13libc-{a,so,multi}-y replaced by libc-y covering common objects both in ↵Peter S. Mazinger
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
2006-02-13Update some copyrightsPeter S. Mazinger
2006-02-13Add files for IMA. Yes, I know it's a hack and no, I won't split the ↵Peter S. Mazinger
affected files
2006-02-13Remove unused filesPeter S. Mazinger
2006-02-13More renames for IMAPeter S. Mazinger
2006-02-13Don't compile arc4random if option not setPeter S. Mazinger
2006-02-09just drop all of the debug codeMike Frysinger
2006-02-08Bernhard Fischer says: get rid of local ret variableMike Frysinger
2006-02-08janlana writes in Bug 700: use standard uint* types rather than u_intMike Frysinger
2006-02-01Go __malloc_lock, go ...Peter S. Mazinger
2006-02-01global data uses libc_hidden_data_def, convert all -I hope- and add some newPeter S. Mazinger
2006-01-31rename local var brk to _brkMike Frysinger
2006-01-30Why this?Peter S. Mazinger
2006-01-29Patch by Joseph S. Myers to add support for ARM EABIMike Frysinger
2006-01-29declare local prototype since we cant use system malloc.hMike Frysinger
2006-01-27Do not build *64 and llseek, correct some failure when LFS is disabledPeter S. Mazinger
2006-01-27Some warnings go awayPeter S. Mazinger
2006-01-26Get rid of missing prototype warningsPeter S. Mazinger
2006-01-24Convert all the strong_aliases to weak that are cancelable in libpthreadPeter S. Mazinger
2006-01-23Make i386 build w/ -std=c99 (almost)Peter S. Mazinger
2006-01-22Enable _GNU_SOURCE build wide, trying to get consistent interfaces, else IMA ↵Peter S. Mazinger
is a useless attempt
2006-01-20fix building/warnings on 64bit archesMike Frysinger
2006-01-20Correction if UNIX98PTY_ONLY is not enabledPeter S. Mazinger