Term
Reasons to use the heap and not the stack (2) |
|
Definition
1) Long-lived data 2) We don't know what data will be coming in ahead of time |
|
|
Term
What happens if we have a function that returns a pointer to something that was stored on the stack? |
|
Definition
|
|
Term
What is in a stack frame? (3) |
|
Definition
1) Parameters 2) Local variables 3) Return address |
|
|
Term
malloc function signature |
|
Definition
void *malloc(size_t size); |
|
|
Term
|
Definition
|
|
Term
What happens if you try to access a variable that has already been freed? |
|
Definition
|
|
Term
calloc function signature |
|
Definition
void *calloc(size_t nmemb, size_t size); |
|
|
Term
realloc function signature |
|
Definition
void *realloc(void *ptr, size_t size); |
|
|
Term
How to check the return address of realloc |
|
Definition
some_ptr = realloc(some_ptr, size); |
|
|