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

Runtime vs. Compiletime ... again #20

Open
gadamico opened this issue May 6, 2016 · 2 comments
Open

Runtime vs. Compiletime ... again #20

gadamico opened this issue May 6, 2016 · 2 comments
Labels

Comments

@gadamico
Copy link

gadamico commented May 6, 2016

So I'm a little confused, again / still, about dynamic memory allocation. I ended up using the stack to allocate my variables in HW 2, but ... well ... I'm not quite sure why that was possible!

Since N, an input to lots of our linear algebra functions, is determined at runtime (?), shouldn't that mean that the parameters depending for their size on N would have to be heap-allocated?

@cswiercz
Copy link
Member

cswiercz commented May 6, 2016

See this thread: #5

One main difference is that (by default) you cannot allocate as much memory on the stack as on the heap.

@cswiercz
Copy link
Member

Another main difference: it's faster to reference stack allocations than heap allocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants