Skip to content

Add linear base allocator #177

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

Merged
merged 4 commits into from
Jan 29, 2024
Merged

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Jan 26, 2024

Add a MT-safe linear base allocator. It is useful for a few, small and different size allocations for a most/whole life-time of an application (free() is not available).

It is needed by #178 and #170.

@ldorau ldorau requested a review from a team as a code owner January 26, 2024 07:58
@ldorau ldorau mentioned this pull request Jan 26, 2024
1 task
@ldorau
Copy link
Contributor Author

ldorau commented Jan 26, 2024

It is needed by #178 and #170

Copy link
Contributor

@bratpiorka bratpiorka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@ldorau ldorau force-pushed the Add_linear_base_allocator branch from 6c06fe0 to 729dbe0 Compare January 26, 2024 10:38
@ldorau ldorau requested a review from igchor January 26, 2024 13:31
@ldorau ldorau force-pushed the Add_linear_base_allocator branch from 729dbe0 to b0f177e Compare January 29, 2024 11:02
Define struct os_mutex_t in utils_concurrency.h
and use it in utils_windows_concurrency.h

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Add_linear_base_allocator branch from b0f177e to ce7514c Compare January 29, 2024 11:10
size_t pool_size;
os_mutex_t lock;
char *data_ptr;
size_t size_left;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably don't need size left - you can calculate that based on pool size and data_ptr. not sure whether that's worth changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to have it saved, than calculate it each time - it is more clear for me.

Add a MT-safe linear base allocator.
It is useful for a few, small and different size allocations
for a most/whole life-time of an application
(free() is not available).

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Add_linear_base_allocator branch from ce7514c to bcbe798 Compare January 29, 2024 11:33
@ldorau ldorau merged commit 6b910ad into oneapi-src:main Jan 29, 2024
@ldorau ldorau deleted the Add_linear_base_allocator branch January 29, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants