On Tuesday, 27 November 2012 at 22:09:21 UTC, Jack Applegame
wrote:
I don't understand why auto ref doesn't work with arrays.
void test1(T)(auto ref const T[] val) {}
void test2(T)(auto ref const T val) {}
void main() {
int b;
test2(b); // OK
string a;
test1(a); // Error: cast(const(char
On Tuesday, 27 November 2012 at 18:04:19 UTC, Maxim Fomin wrote:
I think it crashes because of using associative array.
Assignment to an absent aa member causes memory allocation
without proper object construction, and immediately after
compiler issues call to opAssign for not-constructed ob
On Monday, 26 November 2012 at 15:44:42 UTC, Joseph Rushton
Wakeling wrote:
Hello all,
I'm writing some code which is meant to represent a network of
linked nodes.
[snip]
Ok, another follow up. I can reproduce your segfault using your
posted code, it is included below. But the interesting th
On Wednesday, 28 November 2012 at 13:09:36 UTC, Dan wrote:
On Monday, 26 November 2012 at 15:44:42 UTC, Joseph Rushton
Wakeling wrote:
Hello all,
I'm writing some code which is meant to represent a network of
linked nodes.
[snip]
Ok, another follow up. I can reproduce your segfault using you
11/28/2012 7:19 AM, Ellery Newcomer пишет:
I find myself using [abusing?] move lately:
import std.algorithm;
import std.stdio;
struct A {
const(int) i;
int j;
int k;
}
void main() {
A* a = new A(); // pretend this is malloc or something
// *a = A(1)
A a2 = A(1);
On Monday, 26 November 2012 at 22:59:49 UTC, jerro wrote:
I don't know when dmd on windows will get SIMD support.
I have checked windows 64 bit dmd alpha now and it already
supports SIMD.
Tnx ;)
On 11/27/2012 01:56 PM, maarten van damme wrote:
Haven't looked at vibe.d yet because it looked more like a library for
writing web apps and normal sockets should be enough.
Didn't know about Tango, I'll try deciphering the original d1 module.
... I mean no offense, but that sounds painful.
On 11/28/2012 02:09 PM, Dan wrote:
It would be interesting to know if Joseph was doing his "testing" out in
unittest or in a main.
In main -- the code you saw attached to my earlier email is the code I was
running.
Thanks very much for your efforts at chasing down the bug!
On Wednesday, 28 November 2012 at 13:43:04 UTC, Maxim Fomin wrote:
On Wednesday, 28 November 2012 at 13:09:36 UTC, Dan wrote:
Actually bug is still there - changing unittest to main() does
not fix program, even if it seems to run correctly. The problem
with memory corruption is that it may ha
On 11/27/2012 06:45 PM, jerro wrote:
You could replace the inner loop with somehting like:
bool excl = exclude.any!(part => name.canFind(part));
std.algorithm seems to generally be running the match in the opposite
direction, if I'm understanding it properly. (Dealing with D template
is alway
A friend of mine reports that the memory usage of the following program
grows continuously when compiled with dmd 2.060 and run on Windows 7 sp1
home premium 64 bit (also on Microsoft Windows [Version 6.1.7600]).
If you are on Windows, could you please say whether you have the same
problem. (I
11/28/2012 10:51 PM, Ali Çehreli пишет:
A friend of mine reports that the memory usage of the following program
grows continuously when compiled with dmd 2.060 and run on Windows 7 sp1
home premium 64 bit (also on Microsoft Windows [Version 6.1.7600]).
If you are on Windows, could you please say
On 11/28/2012 12:57 PM, Dmitry Olshansky wrote:
11/28/2012 10:51 PM, Ali Çehreli пишет:
A friend of mine reports that the memory usage of the following program
grows continuously when compiled with dmd 2.060 and run on Windows 7 sp1
home premium 64 bit (also on Microsoft Windows [Version 6.1.760
On Wednesday, 28 November 2012 at 18:08:59 UTC, Dan wrote:
Thanks! I see what you are saying in valgrind. However, the
following shows no problem in valgrind. Same code, only using S
instead of RefCounted!(int).
How could that be explained?
Note that both RefCount!() and your posted S have opAs
On 11/28/2012 11:11 AM, 1100110 wrote:
> On 11/28/2012 12:57 PM, Dmitry Olshansky wrote:
>> 11/28/2012 10:51 PM, Ali Çehreli пишет:
>>> A friend of mine reports that the memory usage of the following program
>>> grows continuously when compiled with dmd 2.060 and run on Windows
7 sp1
>>> home pr
OTOH, I still don't know where "any" is documented. It's
clearly some sort of template instantiation, but it doesn't
seem to be defined in either std.string or std.object (or
anywhere else I've thought to check). And it look as if it
would be something very useful to know.
It's documented h
On 11/28/2012 02:53 PM, Ali Çehreli wrote:
On 11/28/2012 11:11 AM, 1100110 wrote:
> On 11/28/2012 12:57 PM, Dmitry Olshansky wrote:
>> 11/28/2012 10:51 PM, Ali Çehreli пишет:
>>> A friend of mine reports that the memory usage of the following
program
>>> grows continuously when compiled with
1. Can be solved using allocators
http://dlang.org/memory.html#newdelete and
http://dlang.org/class.html#ClassAllocator (here deprecated)?
2. Why with
class Too
{
private uint[] pp;
this(int s)
{
pp = new unit[s];
}
alias pp this;
}
Only 3 iterations before out of memory excepti
On Wednesday, 28 November 2012 at 20:30:41 UTC, Maxim Fomin wrote:
On Wednesday, 28 November 2012 at 18:08:59 UTC, Dan wrote:
This code with version=bug produces garbage because of
opAssign. It seems that opAssign is actually called before
accessing map:
Maxim, thanks for looking more at t
When trying to compile this code:
import std.stdio;
class A;
class B(T) : T {
}
void main() {
writeln(typeid(B!A));
}
I get this error: Assertion failure: '!scope' on line 358 in file
'toobj.c'.
Shouldn't it be more like: Error: class main.A unable to resolve
forward reference in definit
comco:
Looks like a bug?
This is what DMD 2.061alpha prints, it doesn't crash:
...\dmd2\src\phobos\std\range.d(603): Error: static assert
"Cannot put a string into a LockingTextWriter"
...\dmd2\src\phobos\std\format.d(2349):instantiated from
here: put!(LockingTextWriter, string)
..
On Wednesday, 9 November 2011 at 17:13:14 UTC, Dejan Lekic wrote:
Sure
nothing prevents me from using setrlimit() in my D app, but
perhaps it is
something to think about a portable way of doing that.
I know I'm over a year late coming in on this conversation, but
how would you use setrlimit(
On Wednesday, 28 November 2012 at 22:02:35 UTC, Michael wrote:
Only 3 iterations before out of memory exception?
Because you used uint instead of ubyte, array is bigger, memory
exhausts faster.
3. Why it helps?
GC.free(data.ptr);
Initial leak happened because for some reason array allocat
23 matches
Mail list logo