Skip to content

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

Merged
ghaerr merged 1 commit intomasterfrom
realloc
Dec 17, 2024
Merged

[libc] Add malloc_usable_size, write general-purpose realloc#2139
ghaerr merged 1 commit intomasterfrom
realloc

Conversation

@ghaerr
Copy link
Copy Markdown
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
@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