On Friday, 21 October 2022 at 12:05:28 UTC, ryuukk_ wrote:
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote:
void test(Foo..)(Foo foos)
I don't know if that's the 1:1 alternative, but that doesn't
compile
onlineapp.d(23): Error: struct `onlineapp.Foo` is not
copyable b
Hi,
I've found strange behavior where:
```D
import std.stdio;
struct Foo
{
@disable this(this);
int x;
}
void test(Foo[] foos...)
{
foreach (ref f; foos) {
writeln(&f, ": ", f.x);
f.x = 0;
}
}
void main()
{
Foo f1 = Foo(1);
Foo f2 = Foo(2);
writeln("
On Monday, 8 November 2021 at 23:26:39 UTC, tchaloupka wrote:
Bug or feature? :)
I've reported it in
https://issues.dlang.org/show_bug.cgi?id=22498.
On Tuesday, 9 November 2021 at 02:43:55 UTC, jfondren wrote:
On Tuesday, 9 November 2021 at 02:41:18 UTC, jfondren wrote:
The expectation is probably that `f.move` set `f` to
`Foo.init`, but the docs say:
Posted too fast. Foo qualifies with its @disable:
```d
struct A { int x; }
struct B { in
Lets have this code:
```D
import core.lifetime : forward;
import core.stdc.stdio;
import std.algorithm : move;
struct Value(T) {
private T storage;
this()(auto ref T val) {
storage = forward!val;
}
ref inout(T) get() inout {
return storage;
}
}
Value!T valu
After a long fiddling with a code that won't compile I've got
this test case:
```D
struct Foo {
this(ref return scope Foo rhs) {}
~this() {}
}
struct Bar {
@disable this(this);
Foo[2] foos;
}
extern (C)
void main() {}
```
When built with `-betterC` switch (dmd as ldc2 works wi
On Tuesday, 13 April 2021 at 12:30:13 UTC, tchaloupka wrote:
I'm not so sure if pages of small objects (or large) that are
not completely empty can be reused as a new bucket or only free
pages can be reused.
Does anyone has some insight of this?
Some kind of GC memory dump and analyzer tool a
On Monday, 12 April 2021 at 07:03:02 UTC, Sebastiaan Koppe wrote:
We have similar problems, we see memory usage alternate between
plateauing and then slowly growing. Until it hits the
configured maximum memory for that job and the orchestrator
kills it (we run multiple instances and have good
On Sunday, 11 April 2021 at 12:20:39 UTC, Nathan S. wrote:
One thing that comes to mind: is your application compiled as
32-bit? The garbage collector is much more likely to leak
memory with a 32-bit address space since it much more likely
for a random int to appear to be a pointer to the int
Hi,
we're using vibe-d (on Linux) for a long running REST API server
and have problem with constantly growing memory until system
kills it with OOM killer.
First guess was some memory leak so we've added periodic call to:
```D
GC.collect();
GC.minimize();
malloc_trim(0);
```
And when called
On Friday, 16 October 2020 at 16:00:07 UTC, Steven Schveighoffer
wrote:
On 10/16/20 9:12 AM, tchaloupka wrote:
So when the exception is thrown within Foo destructor (and
it's bad on it's own but can easily happen as destructors
aren't nothrow @nogc by default).
Is this behavior expected?
I
Found a pretty nasty bug in vibe-d:
https://github.com/vibe-d/vibe.d/issues/2484
And it's caused by this behavior.
```D
import std;
struct Foo {
Bar bar;
bool err;
~this() {
// scope(failure) destroy(bar); // < this fixes the Bar
destructor call
enforce(!err, "Te
On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote:
On 2020-03-07 12:10:27 +, Jonathan M Davis said:
DateTime dt =
DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00",
regex("\\+"))[0]);
IMO such a string should be feedable directly to the function.
You just need to
On Wednesday, 26 February 2020 at 20:06:20 UTC, mark wrote:
There seems to be some support for SQLite 3 in std. lib. etc
when looking at the stable docs:
https://dlang.org/phobos/etc_c_sqlite3.html
But this isn't visible when looking at stable (ddox).
Is this the best SQLite 3 library to use o
On Wednesday, 5 February 2020 at 13:05:59 UTC, Eko Wahyudin wrote:
Hi all,
I'm create a small (hallo world) application, with DMD.
But my program create 7 annoying threads when create an empty
class.
If you don't want the parallel sweep enabled for your app, you
can turn it of ie with:
`
On Saturday, 23 March 2019 at 17:33:31 UTC, tchaloupka wrote:
I've no idea what should be done with C's main thread as it
can't be attached because it'll hang.
In one of forum threads I've also read the idea to not using
foreign threads with GC but somehow delegate their work to D's
thread.
Can
On Saturday, 23 March 2019 at 15:28:34 UTC, Ali Çehreli wrote:
On 03/22/2019 12:34 PM, tchaloupka wrote:
> I've searched a lot at it should be working at least on
linux, but
> apparently is not or I'm doing something totally wrong..
>
> Our use case is to call shared D library from C# (.Net Core)
On Saturday, 23 March 2019 at 15:58:07 UTC, Sobaya wrote:
What I am saying is that it can not be read when a code
importing (a.d) a code including the static constructor (b.d)
is compiled into shared library.
Hi. I've tried to add your case to the repository and at it seems
to be working for
On Saturday, 23 March 2019 at 09:47:55 UTC, Andre Pany wrote:
On Friday, 22 March 2019 at 19:34:14 UTC, tchaloupka wrote:
Just to make sure, could you test it with dmd 2.78?
Actually when I remove the explicit GC call within unregistered
thread (which is fixed in
https://github.com/dlang/drun
I've searched a lot at it should be working at least on linux,
but apparently is not or I'm doing something totally wrong..
Our use case is to call shared D library from C# (.Net Core) and
from different threads.
What I've read about this, is that foreign thread should be
registered by `thre
Is this expected?:
```
import std.stdio;
import std.algorithm;
import std.array;
void main()
{
auto d = Appender!string();
//auto d = appender!string(); // works
string[] arr = ["foo", "bar", "baz"];
arr.joiner("\n").copy(d);
writeln(d.data);
}
```
Using Appender outpust no
On Tuesday, 6 October 2015 at 05:54:44 UTC, Jonathan M Davis
wrote:
It is by design, albeit undesirable. When SysTime was
originally written, it was impossible to have a default value
for a class reference other than null. So, unless SysTime was
going to take the performance hit of constantly c
This code:
import std.stdio;
import std.datetime;
void main()
{
SysTime t = SysTime.init;
writeln(t);
}
results in segfault with dmd-2.068.2
Is it ok?
Backtrace:
#0 0x004733f3 in std.datetime.SysTime.adjTime() const ()
#1 0x004730b9 in std.datetime.SysTime.toSimpleS
This bites me again:
import std.stdio;
interface ITest
{
void test();
void test2()
in { writeln("itest2"); }
void test3()
in { writeln("itest3"); }
void test4()
in { writeln("itest4"); assert(false); }
}
class Test: ITest
{
void test()
in { writeln("ctest"
On Tuesday, 25 August 2015 at 18:29:08 UTC, Vladimir Panteleev
wrote:
I think this is a bug, but is easily worked around with:
auto test(string a) {
return .test(a, "b");
}
Thanks, this worked.
Filled it: https://issues.dlang.org/show_bug.cgi?id=14965
import std.stdio;
import std.range : chain;
auto test(string a) {
return test(a, "b");
}
auto test(string a, string b) {
return chain(a, b);
}
void main() {
writeln(test(a));
}
Ends with: Error: forward reference to inferred return type of
function call 'test'
I know this exact
On Wednesday, 1 April 2015 at 16:08:14 UTC, John Colvin wrote:
On Wednesday, 1 April 2015 at 13:52:06 UTC, tchaloupka wrote:
I'm pretty sure that the flipping happens in GDI+ as well. You
might be writing C#, but the code your calling that's doing all
the work is C and/or C++, quite possibly
On Wednesday, 1 April 2015 at 14:00:52 UTC, bearophile wrote:
tchaloupka:
Am I doing something utterly wrong?
If you have to perform performance benchmarks then use ldc or
gdc.
I tried it on my slower linux box (i5-2500K vs i7-2600K) without
change with these results:
C# (mono with it
Hi,
I have a bunch of square r16 and png images which I need to flip
horizontally.
My flip method looks like this:
void hFlip(T)(T[] data, int w)
{
import std.datetime : StopWatch;
StopWatch sw;
sw.start();
foreach(int i; 0..w)
{
auto row = data[i*w..(i+1)*w]
29 matches
Mail list logo