summaryrefslogtreecommitdiff
path: root/media/libvpx/vp8_rtcd_x86-win32-gcc.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-01-03 01:07:30 -0500
committerMatt A. Tobin <email@mattatobin.com>2021-01-03 01:07:30 -0500
commiteeeb4b4494690dd7d74f6ef7e6488a1cb740db96 (patch)
tree118d2d44b0339be68410aea07185cf5e2d354de6 /media/libvpx/vp8_rtcd_x86-win32-gcc.h
parent663fc9f394df26635d33f67d8541b3ceed540f83 (diff)
downloaduxp-eeeb4b4494690dd7d74f6ef7e6488a1cb740db96.tar.gz
Issue #1699 - Part 3: Update and rework jemalloc for compatibility with modern FreeBSD
- Fixes a bootstrapping loop between FreeBSD's pthread implementation and current mozjemalloc code ('pthread_mutex_lock' called in 'malloc_init/malloc_mutex_lock' itself calls 'calloc', resulting in 'malloc_init' being called again). - Reuses Linux code (adaptive mutexes interface is the same), as well as Solaris' for ncpus, which is actually POSIX-compliant. Adaptive mutex use is used under __FreeBSD__ instead of MOZ_MEMORY_BSD, since this interface is not always present on the other BSDs. - Creates a simple memory allocator meant to be use during jemalloc bootstrap (malloc_init_hard()). Although protected by "#ifdef __FreeBSD__", it is not FreeBSD-specific: Any POSIX platform could use it. - Hooks it up so that it is used in place of jemalloc's own routines while malloc_init_hard() is executing or memory for mutexes is allocated. Currently, 'malloc', 'calloc', '*memalign' and 'free' are diverted during init or lock initializations. - Removes 'malloc_initializing' by making sure the initialization done for multi-threading will be triggered first by one of the 'malloc_lock_init' calls. This initialization happens only at first lock (pthread_mutex_lock), as reading libthr's code confirms (and not in 'pthread_mutex_init'). So, lock and unlock the just created mutex in 'malloc_mutex_init'. If multi-threading initialization in libthr is at some point moved to 'pthread_mutex_init', this will continue to work (and be a no-op). - Since FreeBSD's code then diverges a bit more from Linux's, separate them, as it also eases code reading.
Diffstat (limited to 'media/libvpx/vp8_rtcd_x86-win32-gcc.h')
0 files changed, 0 insertions, 0 deletions