On Monday, 31 January 2022 at 08:54:16 UTC, Patrick Schluter
wrote:
-O3 often chooses longer code and unrollsmore agressively
inducing higher miss rates in the instruction caches.
-O2 can beat -O3 in some cases when code size is important.
That is generally true. My point is that GCC and
On Tuesday, 25 January 2022 at 22:33:37 UTC, H. S. Teoh wrote:
interesting because idivl is known to be one of the slower
instructions, but gdc nevertheless considered it not worthwhile
to replace it, whereas ldc seems obsessed about avoid idivl at
all costs.
Interesting indeed. Two
static if (...) {
} else static if (...) {
} else {
static assert(0);
}
On Thursday, 25 November 2021 at 08:06:27 UTC, rumbu wrote:
Is that ok or it's a lexer bug?
@ (12) does exactly what I would expect. @nogc I always assumed
was a single token, but the spec says otherwise. I suppose that
makes sense.
#line is dicier as it is not part of the grammar
On Thursday, 11 November 2021 at 13:22:15 UTC, Basile B. wrote:
As for now, I know no compiler that can do that.
GCC can do it. Somewhat notoriously, LTO can lead to bugs from
underspecified asm constraints following cross-TU inlining.
On Sunday, 31 October 2021 at 10:32:50 UTC, Imperatorn wrote:
What I would like is for it to mirror math.
Use bigints.
On Sunday, 31 October 2021 at 02:56:35 UTC, Ali Çehreli wrote:
On 10/30/21 3:47 PM, Elronnd wrote:
> If the GC were moving, it would also have to move the
pointers you took
> to AA elements.
I doubt D's GC can ever change pointer values because the
values may be hiding inside e.g. ulong
On Saturday, 30 October 2021 at 21:20:15 UTC, Stanislav Blinov
wrote:
On Saturday, 30 October 2021 at 20:19:58 UTC, Imperatorn wrote:
https://dlang.org/spec/garbage.html#pointers_and_gc
What test could be written to verify the behaviour?
Assuming the GC was moving?
If the GC were moving,
On Friday, 22 October 2021 at 09:01:53 UTC, Kagamin wrote:
Actually C runtime is many megabytes in size.
A couple of samples:
$ wc -c /usr/lib/libc-2.33.so
2150424 /usr/lib/libc-2.33.so
% wc -c /lib/libc.so.7
1981952 /lib/libc.so.7
I would hardly call two megabytes 'many'.
On Friday, 15 October 2021 at 21:47:21 UTC, Paul Backus wrote:
static global(alias value) = value;
I fear there will be issues with reentrancy.
On Tuesday, 12 October 2021 at 09:20:42 UTC, Elronnd wrote:
problematic wrt threading
Not to mention signals. Reentrancy's a bitch.
On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote:
What's a reliable test that could be used in a toStringz that
skips allocation when given a string in read-only memory?
There is no good way.
- You could peek in /proc, but that's not portable
- You could poke the data and catch
On Saturday, 25 September 2021 at 07:53:11 UTC, Chris Katko wrote:
Is that some sort of "NP complete" can't-fix issue or something?
The general case is obviously unsolvable. Trivial proof: float x
= nan; if (undecidable) use x. I'm sure your imagination can
supply more realistic cases (but
On Tuesday, 14 September 2021 at 03:24:45 UTC, max haughton wrote:
On Tuesday, 14 September 2021 at 03:19:46 UTC, Elronnd wrote:
On Monday, 13 September 2021 at 11:40:10 UTC, max haughton
wrote:
The dragon book barely mentions SSA for example
In fairness, dmd doesn't use SSA either
That's
On Monday, 13 September 2021 at 11:40:10 UTC, max haughton wrote:
The dragon book barely mentions SSA for example
In fairness, dmd doesn't use SSA either
On Monday, 21 June 2021 at 03:59:10 UTC, someone wrote:
Is there a way to filter the collection at the foreach-level to
avoid the inner if ?
Here's how I would do it:
foreach (k, v; coll) {
if (k == unwanted) continue;
...
}
You still have an if, but the actual loop body doesn't have
Meson doesn't track dependencies properly for d, so your dirty
builds will be wrong if you go that route.
You might consider keeping the c and d code in the same
repository, but with separate build systems; using dub to build
the d code and and whatever tool you prefer for c. Or try reggae.
On Monday, 11 January 2021 at 06:26:41 UTC, evilrat wrote:
Android itself is just linux under the hood, however the
launcher starts java process that fires up your activity class
(main in native languages) from there you just call your native
code and that's it.
It turns out that you don't
On Thursday, 24 December 2020 at 23:46:58 UTC, Elronnd wrote:
reduced version:
Further reduction: Alloc1 can just be ‘AllocatorList!(n =>
Region!Mallocator(MB))’.
On Thursday, 24 December 2020 at 16:12:31 UTC, Saurabh Das wrote:
This causes a segfault when run with rdmd -gx:
*snip*
First, here's a reduced version:
void main() {
import std.experimental.allocator: allocatorObject, expandArray;
import
On Sunday, 29 November 2020 at 16:05:04 UTC, Mark wrote:
I have no good understanding why "garbage collection" is a big
thing and why "garbage detection" is no thing (I think so).
Because it's just as expensive to do garbage detection as
automatic garbage collection. So if you're going to go
On Sunday, 27 September 2020 at 18:30:10 UTC, Imperatorn wrote:
I converting it using VisualD:
https://pastebin.com/jzwKRnKZ
Try it, maybe it works
Somehow, I don't think this is going to fly:
static if(__cplusplus) {
extern (C) {/* Assume C declarations for C++ */
} /*
On Wednesday, 23 September 2020 at 04:15:51 UTC, mw wrote:
What do you mean by saying "it's definitely not safe" here?
I mean: if I'm careful and know what I'm doing, e.g. remove all
the reference to any part of the `object` before call
core.memory.GC.free(object), is there still any inherit
printers[i] = () { write(i); };
I know it looks silly but if you make that:
printers[i] = (int i) { return () { write(i); }; }(i);
it will do what you want.
Or, the slightly prettier (imo)
printers[i] = ((i) => () => write(i))(i);
Or, if you need to force it to
You can control when the gc runs. So if you know the allocations
are small enough that they won't OOM, then you can say
GC.disable, and it straight up won't run at all. But you can
manually run a collection cycle (during a loading screen or
whatever) with GC.collect. See
On Tuesday, 26 November 2019 at 03:06:52 UTC, Omar wrote:
the page here https://dlang.org/spec/function.html
suggests you can implement a function in a different file, and
a different tutorial somewhere else mentioned the endeavour of
no-bodied-functions as a way of presenting a black-box type
Up to now I was able to compile just "First Triangle example"
https://www.dropbox.com/sh/myem3g69qjyo58v/AABZuvwuRDpnskhEC4AAK5AVa?dl=
Why not start with that, then, and expand it until it has
everything you need?
If it helps, the basic gl startup code for my engine is at
http://ix.io/1Z2X/d
Dub add is not supported in dub 1.11.0
Use 'dub fetch'.
dmd bla.d bla2.d -shared -fPIC -oflibbla.so
Well the purpose of the exercise kind of *is* to write a prime
number generator. You can look up prime number sieves and
algorithms. For REALLY large numbers, that takes an insane
amount of time, and you can instead use algorithms such as the
ones outlined at
Here's a simple solution. Just make Bar a pointer and free it
before it can be destructed!
import std.stdio;
struct Bar {
~this() {
writeln("~bar");
}
}
struct Foo {
Bar *bar;
this(int why_the_fuck_dont_structs_have_default_constructors)
{
bar = new Bar;
Here's a simple solution. Just make Bar a pointer and free it
before it can be destructed!
import std.stdio;
struct Bar {
~this() {
writeln("~bar");
}
}
struct Foo {
Bar *bar;
this(int why_the_fuck_dont_structs_have_default_constructors)
{
bar = new Bar;
On Tuesday, 29 August 2017 at 00:52:11 UTC, Cecil Ward wrote:
I don't know when the GC actually gets a chance to run.
Another alternative that I *think* (maybe someone who knows a bit
more about the gc can chime in?) would work is if you manually
stopped the gc then ran collections when
Thank you! Would you mind telling me what you changed aside from
pow() and powm()? diff isn't giving me readable results, since
there was some other stuff I trimmed out of the original file.
Also, while this is a *lot* better, I still get some lag
generating 1024-bit primes and I can't
I'm working on writing an RSA implementation, but I've run into a
roadblock generating primes. With a more than 9 bits, my program
either hangs for a long time (utilizing %100 CPU!) or returns a
composite number. With 9 or fewer bits, I get primes, but I have
to run with a huge number of
35 matches
Mail list logo