Skip to content
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

[libc] Add malloc_usable_size, write general-purpose realloc #2139

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Dec 17, 2024

Adds size_t malloc_usable_size(void *ptr) which returns the allocated size of a malloc'd pointer.

Used that routine in writing a general-purpose realloc which then calls malloc/free with the correct size for memcpy. This general purpose realloc will allow for replacing malloc and free wholesale with __amalloc and __afree wholesale in the 8086 toolchain. The toolchain will be ready for updating after writing that wrapper function which also switches out large requests to fmemalloc. Next PR coming shortly.

@ghaerr ghaerr merged commit 3f7f4ff into master Dec 17, 2024
2 checks passed
@ghaerr ghaerr deleted the realloc branch December 17, 2024 02:09
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.

1 participant