Menu

Commit [r389]  Maximize  Restore  History

- In libunix.a malloc(), calloc() and realloc() no longer treat a

request to allocate 0 bytes as an error, returning NULL. They all
return a pointer sized memory chunk (= four bytes) initialized to
NULL (= 0) instead.

- The alloca() implementation which allocates memory from the system
rather than the local stack frame is thread-safe now. It also
interacts with the realloc(), calloc(), free() and malloc() functions
in that the alloca() cleanup routine is called once alloca() has
done its job. If all the memory allocated through alloca() has been
released no further calls to the cleanup function will be made.

- In the thread-safe library, realloc() permitted two different overlapping
calls to succeed in trying to reallocate the same chunk of memory due to
a race condition. Fixed.

obarthel 2005-11-27

changed /trunk/library/GNUmakefile.68k
changed /trunk/library/GNUmakefile.os4
changed /trunk/library/changes
changed /trunk/library/smakefile
changed /trunk/library/stdlib_alloca.c
changed /trunk/library/stdlib_free.c
changed /trunk/library/stdlib_headers.h
changed /trunk/library/stdlib_malloc.c
changed /trunk/library/stdlib_memory.h
changed /trunk/library/stdlib_protos.h
changed /trunk/library/stdlib_realloc.c
/trunk/library/GNUmakefile.68k Diff Switch to side-by-side view
Loading...
/trunk/library/GNUmakefile.os4 Diff Switch to side-by-side view
Loading...
/trunk/library/changes Diff Switch to side-by-side view
Loading...
/trunk/library/smakefile Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_alloca.c Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_free.c Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_headers.h Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_malloc.c Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_memory.h Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_protos.h Diff Switch to side-by-side view
Loading...
/trunk/library/stdlib_realloc.c Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.