mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
fix pthread initalization of mutexes
This commit is contained in:
parent
768872e4e0
commit
6b15342709
2 changed files with 5 additions and 4 deletions
|
@ -441,13 +441,13 @@ static inline void mi_lock_release(mi_lock_t* lock) {
|
||||||
pthread_mutex_unlock(lock);
|
pthread_mutex_unlock(lock);
|
||||||
}
|
}
|
||||||
static inline void mi_lock_init(mi_lock_t* lock) {
|
static inline void mi_lock_init(mi_lock_t* lock) {
|
||||||
(void)(lock);
|
pthread_mutex_init(lock, NULL);
|
||||||
}
|
}
|
||||||
static inline void mi_lock_done(mi_lock_t* lock) {
|
static inline void mi_lock_done(mi_lock_t* lock) {
|
||||||
(void)(lock);
|
pthread_mutex_destroy(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
#elif defined(__cplusplus)
|
#elif defined(__cplusplus)
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -469,6 +469,7 @@ static inline void mi_lock_init(mi_lock_t* lock) {
|
||||||
static inline void mi_lock_done(mi_lock_t* lock) {
|
static inline void mi_lock_done(mi_lock_t* lock) {
|
||||||
(void)(lock);
|
(void)(lock);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -863,7 +863,7 @@ void _mi_arena_field_cursor_init(mi_heap_t* heap, mi_subproc_t* subproc, mi_aren
|
||||||
current->start = (heap == NULL || max_arena == 0 ? 0 : (mi_arena_id_t)(_mi_heap_random_next(heap) % max_arena));
|
current->start = (heap == NULL || max_arena == 0 ? 0 : (mi_arena_id_t)(_mi_heap_random_next(heap) % max_arena));
|
||||||
current->end = current->start + max_arena;
|
current->end = current->start + max_arena;
|
||||||
}
|
}
|
||||||
mi_assert_internal(current->start < max_arena);
|
mi_assert_internal(current->start <= max_arena);
|
||||||
}
|
}
|
||||||
|
|
||||||
static mi_segment_t* mi_arena_segment_clear_abandoned_at(mi_arena_t* arena, mi_subproc_t* subproc, mi_bitmap_index_t bitmap_idx) {
|
static mi_segment_t* mi_arena_segment_clear_abandoned_at(mi_arena_t* arena, mi_subproc_t* subproc, mi_bitmap_index_t bitmap_idx) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue