DragonFlyBSD/src 8356845lib/libthread_xu/thread thr_spec.c thr_private.h

pthreads - Use mmap() for thread->specific data

* Any application which tries to replace malloc() can wind up causing
  pthreads to implode due to its use of malloc() in the early thread
  initialization code.

* Change pthread_setspecific() to use mmap() instead of malloc()
  to allocate the per-thread keys array, allowing applications
  which replace malloc() to use pthread_setspecific() to initialize
  per-thread malloc data if so desired.

  The use of pthread_setspecific() predates TLS (per-thread) variable
  declarations, aka the __thread storage qualifier, which is the
  better way to implement per-thread data, but it is still a reasonable
  choice so make it work.

* For DragonFlyBSD this is not expected to improve chrome because
  our chrome build uses our base malloc() and does not try to replace
  it with tcmalloc().  However, this change might help a limited
  number of other applications that do.

Reported-by: sephe, tuxillo
DeltaFile
+30-14lib/libthread_xu/thread/thr_spec.c
+1-0lib/libthread_xu/thread/thr_private.h
+31-142 files

UnifiedSplitRaw