@@ -128,13 +128,6 @@ static umf_memory_pool_handle_t Proxy_pool = NULL;
128
128
// it protects us from recursion in umfPool*()
129
129
static __TLS int was_called_from_umfPool = 0 ;
130
130
131
- // This WA for the issue:
132
- // https://github.com/oneapi-src/unified-memory-framework/issues/894
133
- // It protects us from a recursion in malloc_usable_size()
134
- // when the JEMALLOC proxy_lib_pool is used.
135
- // TODO remove this WA when the issue is fixed.
136
- static __TLS int was_called_from_malloc_usable_size = 0 ;
137
-
138
131
/*****************************************************************************/
139
132
/*** The constructor and destructor of the proxy library *********************/
140
133
/*****************************************************************************/
@@ -478,18 +471,15 @@ size_t malloc_usable_size(void *ptr) {
478
471
return 0 ; // unsupported in case of the ba_leak allocator
479
472
}
480
473
481
- if (!was_called_from_malloc_usable_size && Proxy_pool &&
482
- (umfPoolByPtr (ptr ) == Proxy_pool )) {
483
- was_called_from_malloc_usable_size = 1 ;
474
+ if (Proxy_pool && (umfPoolByPtr (ptr ) == Proxy_pool )) {
484
475
was_called_from_umfPool = 1 ;
485
476
size_t size = umfPoolMallocUsableSize (Proxy_pool , ptr );
486
477
was_called_from_umfPool = 0 ;
487
- was_called_from_malloc_usable_size = 0 ;
488
478
return size ;
489
479
}
490
480
491
481
#ifndef _WIN32
492
- if (! was_called_from_malloc_usable_size && Size_threshold_value ) {
482
+ if (Size_threshold_value ) {
493
483
return System_malloc_usable_size (ptr );
494
484
}
495
485
#endif /* _WIN32 */
0 commit comments