Skip to content

Global base alloc free function now does not require size param #272

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 1 commit into from
Mar 1, 2024

Conversation

igchor
Copy link
Member

@igchor igchor commented Feb 28, 2024

Also, implement malloc_usable_size and aligned_alloc for global
base alloc.

@igchor igchor requested a review from a team as a code owner February 28, 2024 16:51
@igchor igchor force-pushed the no_size_global_alloc branch from 60ac276 to 71e8eaa Compare February 28, 2024 17:43

size_t ptr_offset_from_original = (uintptr_t)user_ptr - (uintptr_t)ptr;

size_t *metadata_loc = (size_t *)((char *)user_ptr - sizeof(size_t));
Copy link
Contributor

Choose a reason for hiding this comment

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

you use "sizeof(size_t)" several times - could you make a define for this with a meaningful name like "METADATA_OFFSET" or similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@igchor igchor force-pushed the no_size_global_alloc branch 2 times, most recently from 67f1c3e to c5ac00d Compare March 1, 2024 17:48
Also, implement malloc_usable_size and aligned_alloc for global
base alloc.
@igchor igchor force-pushed the no_size_global_alloc branch from c5ac00d to b141ce2 Compare March 1, 2024 17:50
@bratpiorka bratpiorka merged commit 548ce5c into oneapi-src:main Mar 1, 2024
@igchor igchor deleted the no_size_global_alloc branch March 1, 2024 18:17
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.

3 participants