Summary: Calling struct.init causes a memory allocation.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Benjamin Thaut <> 2012-01-11 09:03:33 
PST ---
struct MemoryBlockInfo
  size_t size;
  long[10] backtrace;
  int backtraceSize;

  this(size_t size)
    this.size = size;

int main(string[] argv)
  MemoryBlockInfo info;
  info = MemoryBlockInfo.init; //array allocation here

This allocation seems totaly unneccesary. Also TypeInfo.init should return a
immutable(void)[] instead of a void[] as it seems totaly illogical to modify
the data retreived by TypeInfo.init.

This is especially critical when working without a GC because one is not able
to free the allocated memory for the array as the allocation gets generated by
the compiler.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to