In reply to @amun0666 "For example, zeromem an": There is a difference between reset and zeroMem. If you use reset on ref object becomes nil ZeroMem can correctly reset things. I think the behavior of reset is recursive. Going through each field and applying reset ZeroMem apply directly to the memory