-
Notifications
You must be signed in to change notification settings - Fork 35
Add TBB pool manager with tests #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
01edfa5
to
4e29509
Compare
src/pool/pool_tbb.c
Outdated
struct tbb_memory_pool *pool = (struct tbb_memory_pool *)pool_id; | ||
enum umf_result_t ret = | ||
umfMemoryProviderFree(pool->mem_provider, ptr, bytes); | ||
if (ret != UMF_RESULT_SUCCESS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really related to this PR, but wouldn't it be better to just implement a 'logging' memory provider (and perhaps a pool as well) that we could wrap around the actual provider (similarly to how we use tracking memory provider)? This way we wouldn't have to add those logs everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there already is a task for that in our Jira, isn't there @bratpiorka ?
src/pool/pool_tbb.c
Outdated
|
||
void tbb_raw_free_wrapper(intptr_t pool_id, void *ptr, size_t bytes) { | ||
struct tbb_memory_pool *pool = (struct tbb_memory_pool *)pool_id; | ||
enum umf_result_t ret = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should store the error in TLS and return it from tbb_free if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_last_allocation_error()
retrieves umf_result_t
representing the error of the last failed allocation operation in this thread (malloc, calloc, realloc, aligned_malloc) - not free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but we can return the result directly from umfPoolFree (tbb_free
). Right now we always return SUCCESS from what I see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tbb_free()
yes, we can, but a return value of pool_free()
is never used or checked in the TBB repo ... Done anyway.
21b7e9e
to
0359feb
Compare
Tests added |
b6bb1f1
to
dbaccbb
Compare
Ready for review |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
dbaccbb
to
f698c69
Compare
ff53b9a
to
3899571
Compare
1b78fed
to
647b388
Compare
src/pool/pool_scalable.c
Outdated
} | ||
|
||
pool_data->mem_provider = provider; | ||
g_tbb_ops.pool_create_v1((intptr_t)pool_data, &policy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this functions returns a status, shouldn't we check it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fabc8bb
to
ea0c8f3
Compare
Signed-off-by: Lukasz Dorau <[email protected]>
ea0c8f3
to
656e509
Compare
No description provided.