Skip to content

Commit 835a6f2

Browse files
ldoraulplewa
authored andcommitted
Revert WA for the issue with jemalloc in the proxy library
This reverts commit a4fced6. Fixes: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent 1d61d03 commit 835a6f2

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/proxy_lib/proxy_lib.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,6 @@ static umf_memory_pool_handle_t Proxy_pool = NULL;
128128
// it protects us from recursion in umfPool*()
129129
static __TLS int was_called_from_umfPool = 0;
130130

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-
138131
/*****************************************************************************/
139132
/*** The constructor and destructor of the proxy library *********************/
140133
/*****************************************************************************/
@@ -478,18 +471,15 @@ size_t malloc_usable_size(void *ptr) {
478471
return 0; // unsupported in case of the ba_leak allocator
479472
}
480473

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)) {
484475
was_called_from_umfPool = 1;
485476
size_t size = umfPoolMallocUsableSize(Proxy_pool, ptr);
486477
was_called_from_umfPool = 0;
487-
was_called_from_malloc_usable_size = 0;
488478
return size;
489479
}
490480

491481
#ifndef _WIN32
492-
if (!was_called_from_malloc_usable_size && Size_threshold_value) {
482+
if (Size_threshold_value) {
493483
return System_malloc_usable_size(ptr);
494484
}
495485
#endif /* _WIN32 */

0 commit comments

Comments
 (0)