-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
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.
.
Signed-off-by: Lukasz Dorau <[email protected]>
Signed-off-by: Lukasz Dorau <[email protected]>
6c06fe0
to
729dbe0
Compare
729dbe0
to
b0f177e
Compare
Define struct os_mutex_t in utils_concurrency.h and use it in utils_windows_concurrency.h Signed-off-by: Lukasz Dorau <[email protected]>
b0f177e
to
ce7514c
Compare
size_t pool_size; | ||
os_mutex_t lock; | ||
char *data_ptr; | ||
size_t size_left; |
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.
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.
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 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]>
ce7514c
to
bcbe798
Compare
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.