Skip to main content

Section 22.15 Vocabulary

Resource Acquisition Is Initialization (RAII):
A programming idiom where resources are acquired and released in a way that ensures proper cleanup, typically by using an object to manage their lifetime.
shallow copy:
A copy of an object that shares the same memory for its non-primitive members, leading to potential issues if the original object is modified or destroyed.
deep copy:
A copy of an object that duplicates all of its data, including any dynamically allocated memory, ensuring that the original and copy are independent.
dynamic memory:
Memory that is allocated at runtime using operators like new and delete in C++. This allows for flexible memory usage, but also requires careful management to avoid leaks.
heap:
A region of memory used for dynamic memory allocation, where blocks of memory can be allocated and freed in an arbitrary order.
stack:
A region of memory used for automatic memory allocation, where function call information is stored.
LIFO:
Last In, First Out - a principle where the last item added to a structure is the first one to be removed, commonly used in stack data structures.
segment (memory):
A contiguous block of memory that is allocated for a specific purpose, such as the stack or heap.
memory leak:
A situation where a program allocates memory but fails to release it, leading to increased memory usage over time.
deallocate:
The process of releasing previously allocated memory back to the system, making it available for future allocations.
Rule of Three:
A guideline in C++ that states if a class manages resources it requires a user-defined destructor, copy constructor, and assignment operator.
subscript operator:
The [] symbols, between which an index is specified to access elements in a container.
You have attempted of activities on this page.