SystemVerilog OOP Mastery · All levels
No Destructors or GC APIs (Handle Lifetime Semantics): Interview Questions
Interview Questions for No Destructors or GC APIs (Handle Lifetime Semantics).
Interview questions
Q1. Can you write a destructor in SystemVerilog classes?
Answer: No. There is no user-defined class destructor construct in SystemVerilog.
Q2. How do you avoid leaks without destructors?
Answer: Design explicit lifecycle methods such as close()/release()/shutdown() and call them deterministically.
Q3. Is setting a handle to null equivalent to C++ delete?
Answer: No. It only removes one reference; reclamation timing is simulator-managed and not a cleanup callback.