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

Avoid large stack allocations on thread stacks. #65

Merged
merged 1 commit into from
Aug 26, 2016

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 26, 2016

OS X and Windows have small thread stacks by default. Allocating audio and video
frames (about 962KB total) on the stack overflows it.


This change is Reviewable

@iphydf
Copy link
Member Author

iphydf commented Aug 26, 2016

@mannol can you review this? You haven't accepted your invitation to the team yet, so I can't assign you the PR.

@iphydf iphydf force-pushed the avoid-stack-alloc branch 2 times, most recently from 69e9307 to 5ff5c1c Compare August 26, 2016 20:09
memset(video_y, 0, sizeof(video_y));
memset(video_u, 0, sizeof(video_u));
memset(video_v, 0, sizeof(video_v));
int16_t *PCM = calloc(960, sizeof (*PCM));
Copy link

Choose a reason for hiding this comment

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

In the rest of the code we use sizeof(TypeName) instead of sizeof(*var). It might be good to keep it consistent here and in other places (if used differently) as well.

OS X and Windows have small thread stacks by default. Allocating audio and video
frames (about 962KB total) on the stack overflows it.
@mannol
Copy link

mannol commented Aug 26, 2016

Reviewed 1 of 1 files at r1.
Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Aug 26, 2016

Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.


auto_tests/toxav_many_test.c, line 165 [r1] (raw file):

Previously, mannol wrote…

In the rest of the code we use sizeof(TypeName) instead of sizeof(*var). It might be good to keep it consistent here and in other places (if used differently) as well.

Done.

Comments from Reviewable

@mannol
Copy link

mannol commented Aug 26, 2016

:lgtm:


Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@mannol
Copy link

mannol commented Aug 26, 2016

Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@mannol
Copy link

mannol commented Aug 26, 2016

:lgtm:


Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@iphydf iphydf merged commit a45356c into TokTok:master Aug 26, 2016
@iphydf iphydf deleted the avoid-stack-alloc branch August 26, 2016 20:28
@iphydf iphydf modified the milestone: v0.0.1 Nov 6, 2016
This pull request was closed.
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