On Saturday, 2 July 2016 at 00:08:10 UTC, Hiemlick Hiemlicker
wrote:
I use a struct with static members so I do not have to
instantiate it. It is essentially a singleton. I want all the
variables to be __gshared. I guess I have to prefix all
variables with it?
Basically I have Foo.i; on
On Saturday, 2 July 2016 at 00:08:10 UTC, Hiemlick Hiemlicker
wrote:
On Friday, 1 July 2016 at 23:36:35 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker
wrote:
On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote:
[...]
Ok, Does that mean
[...]
Couple of things could be happening.
1) Alignments are off, aligning of data really really matters when
dealing with executable code.
2) For Windows only. Don't forget to call FlushInstructionCache. Before
executing.
On Saturday, 25 June 2016 at 17:52:48 UTC, Andre Pany wrote:
On Saturday, 25 June 2016 at 17:26:03 UTC, Andre Pany wrote:
On Saturday, 25 June 2016 at 16:05:30 UTC, Vladimir Panteleev
wrote:
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Does D/Phobos has any support for thunks?
The following code works on dmd x64. Fails on dmd x32 and ldc
x64. The problem is the passed variable.
import std.stdio;
version (Windows)
{
import core.sys.windows.windows;
void makeExecutable(ubyte[] code)
{
DWORD old;
VirtualProtect(code.ptr, code.length,
On Friday, 1 July 2016 at 23:36:35 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker
wrote:
On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker
wrote:
Ok, Does that mean
void main()
{
On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker wrote:
On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker
wrote:
Ok, Does that mean
void main()
{
static struct Foo{}
foo();
}
void foo()
{
Foo f;
}
On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker
wrote:
what exactly does this do? are all members _gshared?
In this case __gshared is a complete NOOP. __gshared has only
an effect on variables. It prevents them to reside in
On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker wrote:
what exactly does this do? are all members _gshared?
In this case __gshared is a complete NOOP. __gshared has only an
effect on variables. It prevents them to reside in the TLS, so
that they can be used by any thread of the
what exactly does this do? are all members _gshared?
On Thursday, 30 June 2016 at 21:56:57 UTC, Special opOps wrote:
How can I get the program stats at run time such as minimum and
maximum amount of memory and cpu used, cpu architecture, os,
etc?
OS is compile-time constant.
http://dlang.org/phobos/std_system.html#.os
Or do you look for
On Friday, 1 July 2016 at 17:34:25 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 17:32:26 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 15:45:35 UTC, Jonathan Marler wrote:
How do casts work under the hood? I'm mostly interested in
what needs to be done in order to cast a class to a
On Friday, 1 July 2016 at 17:32:26 UTC, Basile B. wrote:
On Friday, 1 July 2016 at 15:45:35 UTC, Jonathan Marler wrote:
How do casts work under the hood? I'm mostly interested in
what needs to be done in order to cast a class to a subclass.
I'd like to know what is being done to determine
On Friday, 1 July 2016 at 15:45:35 UTC, Jonathan Marler wrote:
How do casts work under the hood? I'm mostly interested in
what needs to be done in order to cast a class to a subclass.
I'd like to know what is being done to determine whether the
object is a valid instance of the cast type.
How do casts work under the hood? I'm mostly interested in what
needs to be done in order to cast a class to a subclass. I'd
like to know what is being done to determine whether the object
is a valid instance of the cast type. If the code is implemented
in the druntime, a pointer to where
On Friday, 1 July 2016 at 06:57:59 UTC, QAston wrote:
On Thursday, 30 June 2016 at 17:08:45 UTC, Jonathan Marler
wrote:
Is there a way to have an associative array of const values? I
thought it would have been:
const(T)[K] map;
map[x] = y;
but the second line gives Error: cannot modify const
On Thursday, 30 June 2016 at 21:18:22 UTC, Luke Picardo wrote:
Why is it so hard to simply get the current date and time
formatted properly in a string?
There are no examples of this in your documentation yet this is
probably one of the most used cases.
To get the current time, use
On Friday, 1 July 2016 at 11:35:40 UTC, ag0aep6g wrote:
Huh? Asserts are ignored with -release. The only exception is
assert(false) which terminates the program immediately, even
with -release.
Aha, that's what I was testing against so therefore the confusion.
On Friday, 1 July 2016 at 10:35:04 UTC, Nordlöw wrote:
I think this is a important issue since asserts are not
optimized away in release mode and D is very much about
performance.
Asserts are removed in release mode, enforce isn't. Here's an
example:
=
void main(string[] args)
{
On 07/01/2016 12:35 PM, Nordlöw wrote:
What's the preferred way of reacting to emptyness in the members front,
back, popFront, popBack --- using assert, enforce, throw, or simply
relying on range-checking in the _store?
I think assert is the most common way of checking. Simply ignoring the
If I have a typical range definition like the following
struct Range
{
@safe pure @nogc:
bool empty() const nothrow
{
return _i == _j;
}
size_t length() const nothrow
{
return _j - _i;
}
bool
I wrote some java-like atomic structs. Please criticize it
https://dpaste.dzfl.pl/24f1438ebb52
On Thursday, 30 June 2016 at 17:08:45 UTC, Jonathan Marler wrote:
Is there a way to have an associative array of const values? I
thought it would have been:
const(T)[K] map;
map[x] = y;
but the second line gives Error: cannot modify const
expression. I would think that the const(T)[K] would
23 matches
Mail list logo