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

Realloc #3072

Closed
wants to merge 3 commits into from
Closed

Realloc #3072

wants to merge 3 commits into from

Conversation

pbarada
Copy link
Contributor

@pbarada pbarada commented Apr 18, 2023

Replace kmalloc/copy/kfree sequences with added krealloc.
Cache task stacks for reuse (saves stack allocation/free for every note played in group tool), reallocating them if too large when cached.

Add code to cache task stacks (reducing them to 3 times INITSTAKSIZE if
too large) to save on next task's creation (which is done for every note
played in group tool).
Replace kmalloc/copy/kfree sequences with new krealloc.
@pbarada pbarada requested a review from nosuchtim April 18, 2023 16:21
Replace kmalloc/copy/kfree of expanding stack with krealloc; if lucky
krealloc didn't move the stack and don't need to update the stack/frame
pointers.
@pbarada pbarada marked this pull request as draft April 19, 2023 14:36
@pbarada
Copy link
Contributor Author

pbarada commented Apr 19, 2023

Grrr, while looking at some other bits, this branch crashes in execerror with "Uknown data type (8) in getnumval!" (at ../lib/maps.k:295). Trying to figure out why...

@pbarada pbarada closed this Apr 19, 2023
@pbarada
Copy link
Contributor Author

pbarada commented Apr 19, 2023

Closing pull request; there's something really weird going on I need to get to the bottom of. Even backing out last commit (that uses realloc in expandstackatleast) that worked yesterday - now fails. 'make regress_stdio" worked yesterday and now fails miserably.
Back to the drawing board...

Copy link
Owner

@nosuchtim nosuchtim left a comment

Choose a reason for hiding this comment

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

Most if/else/for statements use braces on the same line, that should be used more consistently. I've been tempted occasionally to add braces to all of the one-line if/else statements (ala Go), but there are a lot of them. Also, use olds==NULL rather than !olds.

@nosuchtim
Copy link
Owner

nosuchtim commented Apr 19, 2023 via email

@pbarada
Copy link
Contributor Author

pbarada commented Apr 19, 2023 via email

@nosuchtim
Copy link
Owner

nosuchtim commented Apr 19, 2023 via email

@pbarada pbarada deleted the realloc branch July 5, 2023 17:53
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.

2 participants