jamesjuett / eecs280-async-lectures

MIT License
4 stars 2 forks source link

Content fix: Exercise missing a delete in Lecture 13 Exercise 3.1 #20

Closed zalhabash closed 10 months ago

zalhabash commented 12 months ago

The exercise asks which programs run out of memory and crash based off a given amount of stack and heap memory. Technically, this program won't crash, but it will still have a memory leak. It appears that was not the intention of the exercise:

This is the program with the issue:

int main() {
  int *arr = new int[10000];
  for (int i = 0; i < 10000; ++i) {
    arr[i] = i;
  }
}