counters for "maximum amount of memory used" and "maximum number of chunks
allocated" to the current figures for these values.
- Fixed the alloca() declaration in <stdlib.h> so that software which keys
off the fact whether or not the alloca preprocessor symbol is defined
will do the right thing.
- Added an optional call-back function which can be called if alloca()
is about to return NULL, which some software does not consider.
Rather than letting such software drop into an illegal memory access
or worse, that call-back function will be invoked instead, which can
print an error message and eventually call abort().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15073 87f5fb63-7c3d-0410-a384-fd976d0f7a62
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.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15070 87f5fb63-7c3d-0410-a384-fd976d0f7a62
was still wrongish for the OS4 library. So I had to change
it *again*. Which probably means that the 68k library will
need further changes...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14894 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Dropped unused stub code which is now redundant because of
the constructor/destructor mechanism.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14891 87f5fb63-7c3d-0410-a384-fd976d0f7a62
Both the library and the user code need to be rebuilt with the
preprocessor symbol __THREAD_SAFE defined to get thread-safe
code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14843 87f5fb63-7c3d-0410-a384-fd976d0f7a62
and dirent data operations. That should do it! While the library is
not reentrant (this is not ixemul.library) it should be thread-safe
now. Thread-safe in the sense of POSIX 1003.1c-1995.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14842 87f5fb63-7c3d-0410-a384-fd976d0f7a62
parameters (which is by default linked in with libunix.a),
regular expressions can no longer prompt dos.library requesters
to appear. However, to be on the safe side, if you are expecting
to pass regular expressions on the command line, do not use
the wildcard expansion code such as by overriding the library
symbols with dummy functions such as are used in the file
"stdlib_wildcard_expand.c".
- Added a new variable '__open_locale' which can be used to
restrict all library functions to use the "C" language locale
rather than the current system locale settings. In addition
to that, two new functions __locale_exit() and __locale_init()
can be used to close and (re-)open the system locale at a
later time.
- Local ("static") functions are now identified by the STATIC
qualifier. This was done in preparation for changes that will
deal with global and local data and the issue of thread safety.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14839 87f5fb63-7c3d-0410-a384-fd976d0f7a62
to the built-in function.
- Updated the stdio.h, stdlib.h, string.h and unistd.h header files
to declare function prototypes for the __MEM_DEBUG versions of the
library functions only if that preprocessor symbol is defined.
- If a SIGINT signal is caught and processed by the default signal
handler, the localized "*** BREAK" string will be printed rather
than the built-in one.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14786 87f5fb63-7c3d-0410-a384-fd976d0f7a62
management code in the default link library along with the
normal versions. Let's see how well this works out in the GCC
version. SAS/C does not seem to like it...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14785 87f5fb63-7c3d-0410-a384-fd976d0f7a62
malloc/free code itself and updated the alloca code to do its
own data management.
- Finally optimized the alloca() memory cleanup code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14784 87f5fb63-7c3d-0410-a384-fd976d0f7a62