www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17592] New: destroy isn't marked nogc when the class


          Issue ID: 17592
           Summary: destroy isn't marked  nogc when the class destructor
                    is marked as  nogc
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: alexanderheistermann gmail.com

Here is the pseudocode example:

 nogc class TestClass 
    int x;

     nogc this(int x) 
        this.x = x;

 nogc void main()
//created a testclass object name obj using emplace and malloc

destroy(obj);//Error occurs here



This is very frustrating for manual memory management by using emplace,
destroy, malloc and free functions in  nogc context.

Based on the memory management example named "Explicit Class Instance
Allocation" on the official dlang website.

Possible related to: 

Jul 03 2017