functions are used for destructors of thread_local objects.
If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.
Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory
leaks on allocation failures and it doesn't depend on malloc(0) != NULL
for correct error checking. Compared to plain realloc, it also avoids
the problem of intermediate integer overflows. The trade-off is the use
of void * to side step C type system with regard to generic pointer to
pointer.
* do not build _errno.c (different thread/tls handling)
* do not build either phk- or jemalloc (different backing page allocation)
Somehow I missed these in the previous commit, but now libc built with
RUMPRUN=yes works also with rumprun-posix, so there's reasonably high
confidence that I didn't miss anything anymore.
- Use RB tree to keep track of memory allocated via setenv(3) as
suggested by Enami Tsugutomo in private e-mail.
This simplifies the code a lot as we no longer need to keep the size
of "environ" in sync with an array of allocated environment variables.
It also makes it possible to free environment variables in unsetenv(3)
if something has changed the order of the "environ" array.
- Fix a bug in getenv(3) and getenv_r(3) which would return bogus
results e.g. for " getenv("A=B") " if an environment variable "A"
with value "B=C" exists.
- Clean up the internal functions:
- Don't expose the read/write lock for the environment to other parts
of "libc". Provide locking functions instead.
- Use "bool" to report success or failure.
- Use "ssize_t" or "size_t" instead of "int" for indexes.
- Provide internal functions with simpler interfaces e.g. don't
combine return values and reference arguments.
- Don't copy "environ" into an allocated block unless we really need
to grow it.
Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by
Joerg Sonnenberger and me. These changes also fix problems in
zsh 4.3.* and pam_ssh according to Joerg.
manual page. This way malloc(3) can follow the standard terse format used
elsewhere in the libc, while additional details can be added to jemalloc(3).
Note HISTORY and AUTHORS in jemalloc(3), and add some reading material to
SEE ALSO.
The algorithm used is the Jenkins hash. The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.
Bump libc minor to 169.
version for signed and one version for unsigned data types.
Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.
Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.
Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
shot-term TODO:
- enable multibyte locales. this includes loadable locale modules
(#ifdef DLRUNE).
- populate LC_CTYPE definition files.
- other functions such as iconv()
- make libc functions more friendly with multibyte.
- multilingualize other LC_xx
- torture tests
XXX don't forget to "make depend" when you rebuild libc, multibyte.c is
moved from lib/libc/stdlib to lib/libc/locale.