[Issue 19191] New: Memory allocation failure with -profile=gc and dynamic array of opaque handles

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 25 19:45:16 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19191

          Issue ID: 19191
           Summary: Memory allocation failure with -profile=gc and dynamic
                    array of opaque handles
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: goalitium at dissues.mail.kapsi.fi

Following minified code from a project using ErupteD Vulkan bindings crashes to
"core.exception.OutOfMemoryError at src/core/exception.d(700): Memory allocation
failed" when compiled with -profile=gc:

struct VkInstance_handle;
alias VkInstance = VkInstance_handle*;

void main()
{
    VkInstance[] instances = new VkInstance[1];
}


This can be worked around by changing the opaque handle declaration to:
struct VkInstance_handle {};


The related issue in ErupteD GitHub:
https://github.com/ParticlePeter/ErupteD/issues/11

--


More information about the Digitalmars-d-bugs mailing list