Skip to content

Commit 3636263

Browse files
committed
add env to enable tracking prov in proxy lib
1 parent 8b86b9d commit 3636263

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ In case of Windows it requires:
312312
2) (C++ code only) including `proxy_lib_new_delete.h` in a single(!) source file in your project
313313
to override also the `new`/`delete` operations.
314314

315+
#### Memory Tracking in the Proxy library
316+
TODO
317+
315318
## Contributions
316319

317320
All contributions to the UMF project are most welcome! Before submitting

src/proxy_lib/proxy_lib.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,21 @@ void proxy_lib_create_common(void) {
138138
}
139139
#endif
140140

141+
umf_pool_create_flags_t pool_flags = UMF_POOL_CREATE_FLAG_DISABLE_TRACKING;
142+
if (utils_env_var_has_str("UMF_PROXY", "tracking=enabled")) {
143+
LOG_DEBUG("proxy_lib: enabling of Tracking Provider");
144+
pool_flags = pool_flags & ~UMF_POOL_CREATE_FLAG_DISABLE_TRACKING;
145+
}
146+
141147
umf_result = umfMemoryProviderCreate(umfOsMemoryProviderOps(), &os_params,
142148
&OS_memory_provider);
143149
if (umf_result != UMF_RESULT_SUCCESS) {
144150
LOG_ERR("creating OS memory provider failed");
145151
exit(-1);
146152
}
147153

148-
umf_result =
149-
umfPoolCreate(umfPoolManagerOps(), OS_memory_provider, NULL,
150-
UMF_POOL_CREATE_FLAG_DISABLE_TRACKING, &Proxy_pool);
154+
umf_result = umfPoolCreate(umfPoolManagerOps(), OS_memory_provider, NULL,
155+
pool_flags, &Proxy_pool);
151156
if (umf_result != UMF_RESULT_SUCCESS) {
152157
LOG_ERR("creating UMF pool manager failed");
153158
exit(-1);

0 commit comments

Comments
 (0)