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

IBA::resize: Use heap instead of stack for an allocation #2643

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Jul 14, 2020

Resizing an enormous image by a large scale factor could end up having
this allocation, which is xresntapssizeof(float), end up big enough
to overflow the stack. It's only done once per thread worker, so there
is no perf penalty to making it a heap allocation just in case it's
too big.

Closes #2004

Signed-off-by: Larry Gritz lg@larrygritz.com

Resizing an enormous image by a large scale factor could end up having
this allocation, which is xres*ntaps*sizeof(float), end up big enough
to overflow the stack. It's only done once per thread worker, so there
is no perf penalty to making it a heap allocation just in case it's
too big.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz merged commit e35dc40 into AcademySoftwareFoundation:master Jul 15, 2020
@lgritz lgritz deleted the lg-alloca branch July 15, 2020 18:55
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.

ImageAlgo stack overflow for huge images
1 participant