Fading Coder

One Final Commit for the Last Sprint

Understanding Garbage Collection

We know that garbage collection is handled by the engine. There are many JavaScript engines (different browsers have different ones), and their garbage collection mechanisms vary in details and optimizations. This article starts with some common collection algorithms, then takes V8 engine as an exam...

Understanding C++ Runtime Polymorphism and Virtual Mechanisms

Core Prerequisites for Polymorphic Behavior Runtime polymorphism in C++ requires two simultaneous conditions. First, a base class method must be marked virtual and subsequently overridden in a derived class. Second, the invocation must occur through a base class pointer or reference. When these cond...

Stack and Heap: Core Concepts in Memory and Data Structures

Stack A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. Only the most recently added element can be accessed or removed. Key Characteristics LIFO behavior: The last element pushed onto the stack is the first one popped off. Single access point: All operations oc...

C++ Shallow and Deep Copy Mechanics

Shallow Copy vs Deep Copy Shallow Copy Mechanics Shallow copying occurs when multiple pointers reference the identical memory address. Altering the data through any of these pointers modifies the underlying memory, affecting all other pointers pointing to that location. Procedural Shallow Copy Illus...

C++ Core Programming: Memory Management, References and OOP Fundamentals

Memory Layout in C++ Code Area: Stores binary code of functions managed by the operating system Global Area: Holds global variables, static variables, and constents Stack Area: Automatically allocated and deallocated by compiler for function parameters and local variables Heap Area: Manually managed...

Principles and C Language Implementation of Sequential Linear Lists

Sequential Storage Concept of Linear Lists A linear list is a finite sequence of data elements, denoted as $L=(a_0, a_1, \dots, a_{n-1})$, where $L$ is the list name, $a_i$ is the data element, and $n$ is the length of the list. When the elements of linear list $L$ are stored consecutively in comput...

Understanding Function Pointers and Pointer Functions in C Programming

The distinction between a pointer to a function and a function that returns a pointer is a fundamental concept in C. A function pointer is a variable that stores the address of a function, enabling dynamic invocation. Conversely, a pointer function is a function whose return type is a pointer to som...

Understanding C++ Const Qualifier and Memory Management

Variables with const When applied to variables, the const qualifier prevents modification after initialization. const int MAX_SIZE = 100; MAX_SIZE = 200; // Compilation error Function Parameters Using const with function parameters ensures the arguemnts remain unmodified within the function scope. v...

JVM Architecture and Garbage Collection Types

What is JVM? JVM stands for Java Virtual Machine. JVM Components Note: Before Java 8, the constant pool was located in the permanent generation within the heap. After Java 8, with the removal of the permanent generation and adoption of metaspace, the constant pool is now in the method area. Program...

Memory Allocation and Wrapper Class Caching in Java

Java manages memory across several distinct regions, with the stack and heap being the most critical for variable and object storage. Primitive types (byte, short, int, long, float, double, char, boolean) retain their raw values directly, while reference types hold pointers to actual objects in memo...