[Issue 16243] wrong C++ argument passing with empty struct and 6 integers

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16243

--- Comment #11 from Brad Roberts  ---
I haven't tested building with clang on osx in ages.  If it's at the point of
passing tests then I'd be happy to convert any/all of the three testers back to
their default compiler.

--


[Issue 16508] New: Alignment of class members is not respected. Affects new, scoped and classInstanceAlignment.

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16508

  Issue ID: 16508
   Summary: Alignment of class members is not respected. Affects
new, scoped and classInstanceAlignment.
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: marco.le...@gmx.de

Illustration:

class A
{
align(8192) ubyte[0x40] i;
}

class B : A
{
import core.simd;
void16 giveMeMyAlignment;
}

void main()
{
import std.stdio, std.traits;
writeln(classInstanceAlignment!B);
writeln(cast(void*)new B);
}

Class B's alignment is 8192 (0x2000), but the program output is:

8
7FEAFA8DF000

This indicates that the alignment directive is silently ignored for `new` and
that we have no access to the actual member alignment through compile-time
reflection. I had to pick a fantasy alignment here, as otherwise the pointers
are always rounded to a value larger than the alignment.

We need a way to get at the actual effective class instance alignment at
compile time and possibly feed that as a compile-time constant into the
`align()` directive for efficient `scoped` implementations.

Before anyone asks, the `scope` keyword to place objects on the stack is also
affected. But that's a general problem with current dmd, that doesn't support
stack alignments > 16 bytes. See:
https://issues.dlang.org/show_bug.cgi?id=16098

--


[Issue 16507] std.experimental.allocator: FreeTree clears too eagerly

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16507

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||pull
   Assignee|nob...@puremagic.com|ag0ae...@gmail.com

--- Comment #1 from ag0ae...@gmail.com ---
https://github.com/dlang/phobos/pull/4798

--


[Issue 16506] segfaults in std.experimental.allocator: FreeTree with GCAllocator or Mallocator

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16506

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||pull
   Assignee|nob...@puremagic.com|ag0ae...@gmail.com

--- Comment #2 from ag0ae...@gmail.com ---
https://github.com/dlang/phobos/pull/4798

--


[Issue 16507] New: std.experimental.allocator: FreeTree clears too eagerly

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16507

  Issue ID: 16507
   Summary: std.experimental.allocator: FreeTree clears too
eagerly
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ag0ae...@gmail.com

Documentatinon [1] says: "If allocation from the parent succeeds, the allocated
block is returned. Otherwise, [...] FreeTree releases all of its contents and
tries again."


import std.experimental.allocator.building_blocks: FreeTree;

struct MyAllocator
{
byte dummy;
static bool alive = true;
void[] allocate(size_t s) { return new byte[](s); }
bool deallocate(void[] ) { if (alive) assert(false); return true; }
enum alignment = size_t.sizeof;
}

void main()
{
FreeTree!MyAllocator ft;
void[] x = ft.allocate(1);
ft.deallocate(x);
ft.allocate(1000);
MyAllocator.alive = false;
}


The assert is hit. It shouldn't be. For the second allocation, ft should
allocate from the parent allocator without deallocating the free block.

Pull request incoming.


[1]
http://dlang.org/phobos/std_experimental_allocator_building_blocks_free_tree.html#.FreeTree.allocate

--


[Issue 13820] switch and case expressions should support alias this types

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13820

Martin Krejcirik  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Martin Krejcirik  ---
Probably fixed by bug 7979

*** This issue has been marked as a duplicate of issue 7979 ***

--


[Issue 7979] Alias this does not work with switch

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7979

Martin Krejcirik  changed:

   What|Removed |Added

 CC||c...@dawg.eu

--- Comment #4 from Martin Krejcirik  ---
*** Issue 13820 has been marked as a duplicate of this issue. ***

--


[Issue 14532] switch block allows creating uninitialized variables

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14532

Martin Krejcirik  changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc

--- Comment #5 from Martin Krejcirik  ---
*** Issue 3820 has been marked as a duplicate of this issue. ***

--


[Issue 3820] Small hole in switch semantics

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3820

Martin Krejcirik  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #8 from Martin Krejcirik  ---


*** This issue has been marked as a duplicate of issue 14532 ***

--


[Issue 16506] segfaults in std.experimental.allocator: FreeTree with GCAllocator or Mallocator

2016-09-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16506

Lodovico Giaretta  changed:

   What|Removed |Added

 CC||lodov...@giaretart.net
Summary|segfaults with  |segfaults in
   |std.experimental.allocator. |std.experimental.allocator:
   |{gc_allocator,mallocator}   |FreeTree with GCAllocator
   ||or Mallocator

--- Comment #1 from Lodovico Giaretta  ---
With the malloc version, I got this output:

malloc.c:2369: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *)
&((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd
&& old_size == 0) || ((unsigned long) (old_size) >= (unsigned
long)__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *
(sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size &
0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.


To me, it looks like the problem is specific to FreeTree. Changing the title to
reflect this.

--