On Sun, Feb 24, 2013 at 03:14:01PM -0800, Charles Hixson wrote:
> Given a struct with:
>
> ~this()
> { close(); }
>
> void close()
> { if (currentKey !is null) currentKey = null;
>if (cursor is null)return;
>tcbdbcurdel(cursor);
> }
>
> and:
>
> scope (exit)
Given a struct with:
~this()
{ close(); }
voidclose()
{ if (currentKey !is null) currentKey = null;
if (cursor is null)return;
tcbdbcurdel(cursor);
}
and:
scope (exit) if (bdb !is null) tcbdbclose(bdb);
//scope(exit) cur.close; // <<- cur
On Sunday, 24 February 2013 at 20:16:26 UTC, Alexandr Druzhinin
wrote:
I used in my application DList (code is large and I couldn't
reduce it) and the application allocates memory always. I can
not realize why and don't know it now. But when I replaced
DList by SList (and even dynamic array) me
I used in my application DList (code is large and I couldn't reduce it)
and the application allocates memory always. I can not realize why and
don't know it now. But when I replaced DList by SList (and even dynamic
array) memory leaks disappeared at all and all works as expected. I know
it is h
On Sunday, 24 February 2013 at 17:30:14 UTC, Damian wrote:
That solution is ok for 1 argument but for many arguments it
wont suffice.
This is issue 5028.
What is the problem with many arguments? I'm probably
misunderstanding, but e.g. this works:
struct MySignal(T...)
{
mixin Signal!T
On Sunday, February 24, 2013 14:05:26 Timon Gehr wrote:
> On 02/24/2013 01:59 PM, Maxim Fomin wrote:
> > On Sunday, 24 February 2013 at 09:00:17 UTC, Jonathan M Davis wrote:
> >> Because main_cont is module-level variable, it must be initialized with a
> >> value at compile time. Classes can be use
On Sunday, February 24, 2013 13:02:46 monarch_dodra wrote:
> My first reaction when I stumbled upon it actually. Then again,
> can't the same be said about lambas? Technically, they *are*
> templates, since the type is determined when they are actually
> called.
>
> Also, when you say "alias", do
On 2/24/13, Jonathan M Davis wrote:
> Those _do_ work. The problem is that you're not trying that; you're trying
> ["foo"].equal(["foo"d]);
Ah that makes sense, thanks.
A run of the mill implementation takes care of things:
bool equal(Range1, Range2)(Range1 r1, Range2 r2)
if (isInputRange!R
On Saturday, 23 February 2013 at 23:39:19 UTC, cal wrote:
On Saturday, 23 February 2013 at 17:01:48 UTC, Damian wrote:
Ok signals work fine, until I use them in a descendant class.
Snippet:
-
import std.signals;
class ClassA
{
public mixin Signal!(int) addNumber1;
}
cl
24.02.2013 23:28, Ali Çehreli пишет:
On 02/24/2013 06:26 AM, Alexandr Druzhinin wrote:
> In the following code http://dpaste.dzfl.pl/f4ae16aa
> memory consumption depends on DATA_SIZE value. Bigger value bigger
> consumption - it's natural. Consumption starts from some value and
> continue to
On 02/24/2013 06:26 AM, Alexandr Druzhinin wrote:
> In the following code http://dpaste.dzfl.pl/f4ae16aa
> memory consumption depends on DATA_SIZE value. Bigger value bigger
> consumption - it's natural. Consumption starts from some value and
> continue to some threshold. After reachin this thresh
24.02.2013 21:26, Alexandr Druzhinin пишет:
In the following code http://dpaste.dzfl.pl/f4ae16aa
memory consumption depends on DATA_SIZE value. Bigger value bigger
consumption - it's natural. Consumption starts from some value and
continue to some threshold. After reachin this threshold comsumpti
24.02.2013 21:26, Alexandr Druzhinin пишет:
In the following code http://dpaste.dzfl.pl/f4ae16aa
memory consumption depends on DATA_SIZE value. Bigger value bigger
consumption - it's natural. Consumption starts from some value and
continue to some threshold. After reachin this threshold comsumpti
In the following code http://dpaste.dzfl.pl/f4ae16aa
memory consumption depends on DATA_SIZE value. Bigger value bigger
consumption - it's natural. Consumption starts from some value and
continue to some threshold. After reachin this threshold comsumption
doesn't enlarge. This threshold depends
On 02/24/2013 01:59 PM, Maxim Fomin wrote:
On Sunday, 24 February 2013 at 09:00:17 UTC, Jonathan M Davis wrote:
Because main_cont is module-level variable, it must be initialized with a
value at compile time. Classes can be used at compile time (at least
some of
the time), but they cannot stick
On Sunday, 24 February 2013 at 09:00:17 UTC, Jonathan M Davis
wrote:
Because main_cont is module-level variable, it must be
initialized with a
value at compile time. Classes can be used at compile time (at
least some of
the time), but they cannot stick around between compile time
and runtime,
m
24.02.2013 15:59, Jonathan M Davis пишет:
Because main_cont is module-level variable, it must be initialized with a
value at compile time. Classes can be used at compile time (at least some of
the time), but they cannot stick around between compile time and runtime,
meaning that you could potent
On Sunday, 24 February 2013 at 11:35:28 UTC, Jonathan M Davis
wrote:
On Sunday, February 24, 2013 12:24:21 monarch_dodra wrote:
On Sunday, 24 February 2013 at 04:47:41 UTC, Jonathan M Davis
wrote:
> However, now that I think about it, equal takes a predicate,
> so
> it would
> probably work t
On Sunday, February 24, 2013 12:24:21 monarch_dodra wrote:
> On Sunday, 24 February 2013 at 04:47:41 UTC, Jonathan M Davis
>
> wrote:
> > However, now that I think about it, equal takes a predicate, so
> > it would
> > probably work to do something like
> >
> > equal!"equal(a, b)"(["hello"d], ["h
On Sunday, 24 February 2013 at 04:47:41 UTC, Jonathan M Davis
wrote:
However, now that I think about it, equal takes a predicate, so
it would
probably work to do something like
equal!"equal(a, b)"(["hello"d], ["hello"]);
- Jonathan M Davis
Yes, and you don't even need to use a mixin.
This i
On Sunday, February 24, 2013 15:42:33 Alexandr Druzhinin wrote:
> This code:
>
> import std.stdio;
> import std.container;
> import std.range;
>
> auto main_cont = redBlackTree(iota(0, 100, 10).array);
>
> void main() {
>
> writeln(main_cont.array);
> }
>
> at compilation with dmd 2.062 ge
This code:
import std.stdio;
import std.container;
import std.range;
auto main_cont = redBlackTree(iota(0, 100, 10).array);
void main() {
writeln(main_cont.array);
}
at compilation with dmd 2.062 generates:
D:\applications\D\dmd2\windows\bin\..\..\src\druntime\import\core\memory.d(316):
22 matches
Mail list logo