On 3/5/21 8:29 PM, Jack wrote:
> Now about the behavior of a static destructor, like static ~this() { }
> is this guaranteed to be run?
I don't know any way of creating a module on the GC heap so their
destruction should not be related to GC collection. I would expect all
'static ~this()'
On Saturday, 6 March 2021 at 04:29:41 UTC, Jack wrote:
Now about the behavior of a static destructor, like static
~this() { } is this guaranteed to be run?
Yes. Some perspective:
1. During program execution, class/struct destructors on
stack-allocated instances are invoked when the
On Friday, 5 March 2021 at 21:24:08 UTC, tsbockman wrote:
On Friday, 5 March 2021 at 21:17:24 UTC, tsbockman wrote:
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
class C {...}
import core.memory : GC;
C c = cast(C) GC.malloc(C.sizeof);
...
...
On Friday, 5 March 2021 at 21:25:52 UTC, Ali Çehreli wrote:
On 3/5/21 12:57 PM, Jack wrote:
>> destroy() executes the destructor.
>
> but I would need to call it manually and only after I
somewhat I've
> determined I no longer need the resources, right? so
destroy(c) would be
> no different
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 08:24:26PM +, Jack via
Digitalmars-d-learn wrote:
On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote:
> On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
[...]
> > But the ones heap may never
On Friday, 5 March 2021 at 02:13:39 UTC, Jack wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent the wheel
[1]: https://devdocs.io/d/std_algorithm_iteration#filter
On Friday, 5 March 2021 at 07:51:24 UTC, Siemargl wrote:
On Friday, 5 March 2021 at 03:32:35 UTC, harakim wrote:
I want this almost every week at work. When I run into some
trivial statement that I need to know for sure how it works,
it's rarely worth it to create a whole new file and make a
On Wednesday, 17 February 2021 at 06:58:55 UTC, Jedi wrote:
I an using pipeShell, I have redirected stdout, stderr, and
stdin.
I am trying to read from the output and display it in my app. I
have followed this code almost exactly except I use try wait
and flush because the app is
On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
Any idea why?
The examples are compiled using an older host compiler
(__VERSION__ is 2.093) but use features introduced in a later
version. This will be fixed by upgrading the compiler (the
examples are checked using current master
On Friday, 5 March 2021 at 22:59:09 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 10:01:37PM +, Imperatorn via
Digitalmars-d-learn wrote:
Basically none of the examples on here compile:
https://dlang.org/library/std/conv/parse.html
Any idea why?
File a bug.
T
Sad that there's such
On Fri, Mar 05, 2021 at 10:01:37PM +, Imperatorn via Digitalmars-d-learn
wrote:
> Basically none of the examples on here compile:
> https://dlang.org/library/std/conv/parse.html
>
> Any idea why?
File a bug.
T
--
By understanding a machine-oriented language, the programmer will tend to
Basically none of the examples on here compile:
https://dlang.org/library/std/conv/parse.html
Any idea why?
On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
Basically none of the examples on here compile:
https://dlang.org/library/std/conv/parse.html
Any idea why?
Output:
onlineapp.d(10): Error: template `std.conv.parse` cannot deduce
function from argument types `!(bool, string,
On Friday, 5 March 2021 at 16:10:02 UTC, Rumbu wrote:
First of all, in 64 bit ABI, parameters are not passed on
stack, therefore a[RBP] is a nonsense.
void complement32(simdbytes* a, simdbytes* b)
a is in RCX, b is in RDX on Windows
a is in RDI, b is in RSI on Linux
I'm confused, with your
On 3/5/21 12:57 PM, Jack wrote:
>> destroy() executes the destructor.
>
> but I would need to call it manually and only after I somewhat I've
> determined I no longer need the resources, right? so destroy(c) would be
> no different from calling my own finalize-like method like
freeResources()?
On Friday, 5 March 2021 at 21:17:24 UTC, tsbockman wrote:
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
class C {...}
import core.memory : GC;
C c = cast(C) GC.malloc(C.sizeof);
...
...
import core.memory : GC;
C c = cast(C)
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
If you know when you can deallocate something, that means you
don't need the GC to collect it, so you could just allocate it
on the malloc heap instead, and call destroy/free once you're
done. You could use the C version of
On Friday, 5 March 2021 at 16:54:48 UTC, Kagamin wrote:
On Wednesday, 3 March 2021 at 20:54:43 UTC, Anthony Quizon
wrote:
I'm having some success pulling out small bits of code from
other libraries and keeping things minimal and c-style-ish.
If you're really ok with minimalism, I'm writing
On Fri, Mar 05, 2021 at 08:24:26PM +, Jack via Digitalmars-d-learn wrote:
> On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote:
> > On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
[...]
> > > But the ones heap may never run at all, is that right?
> >
> > You can't rely on the
On Friday, 5 March 2021 at 20:28:58 UTC, Ali Çehreli wrote:
On 3/5/21 12:24 PM, Jack wrote:
Are there some kind of replacement or I have to make my own
finalize-like method, once I determine somewhat the
application no longer need those resources?
destroy() executes the destructor.
but I
On 3/5/21 12:24 PM, Jack wrote:
Are there some kind of replacement or I have to make my own
finalize-like method, once I determine somewhat the application no
longer need those resources?
destroy() executes the destructor.
To my surprise, even though 'c' is not null below, the destructor is
On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
On Friday, 5 March 2021 at 20:10:39 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On
On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
On Friday, 5 March 2021 at 20:10:39 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
[...]
On Friday, 5 March 2021 at 20:10:39 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it
did
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it
did happens whenever I did a memory allocation. Is this not
possible
On Fri, Mar 05, 2021 at 08:03:58PM +, Jack via Digitalmars-d-learn wrote:
> On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
> > On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
> > > The following code returns a memory error. I did notice it did
> > > happens whenever I did a
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
On Friday, 5 March 2021 at 19:26:38 UTC, Jacob Carlborg wrote:
On 2021-03-05 19:49, realhet wrote:
Why it works with each (or foreach), but not with map? o.O
`lockstep` is specifically designed to work with `foreach`. I
think `each` has a special case to work with `lockstep`. If you
want
On 2021-03-05 19:49, realhet wrote:
Why it works with each (or foreach), but not with map? o.O
`lockstep` is specifically designed to work with `foreach`. I think
`each` has a special case to work with `lockstep`. If you want to use
other range functions, you should use `zip` instead of
On Friday, 5 March 2021 at 05:42:03 UTC, evilrat wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
GC prohibits
Hi
What am I doing wrong here?
import std.stdio, std.range, std.algorithm, std.uni, std.utf,
std.conv, std.typecons, std.array;
auto SE(A, B)(in A a, in B b){
return (a-b)^^2;
}
void main(){
auto a = [1, 2, 3], b = [1, 1, 1];
lockstep(a, b,
On Thursday, 4 March 2021 at 23:57:25 UTC, kinke wrote:
On Thursday, 4 March 2021 at 22:30:17 UTC, tastyminerals wrote:
I got a company MacBook with M1 chip and gradually migrate all
the stuff from Linux machine. I got precompiled ldc binary
installed without any problem now is the time for
On Friday, 5 March 2021 at 16:54:48 UTC, Kagamin wrote:
On Wednesday, 3 March 2021 at 20:54:43 UTC, Anthony Quizon
wrote:
I'm having some success pulling out small bits of code from
other libraries and keeping things minimal and c-style-ish.
If you're really ok with minimalism, I'm writing
On Wednesday, 3 March 2021 at 20:54:43 UTC, Anthony Quizon wrote:
I'm having some success pulling out small bits of code from
other libraries and keeping things minimal and c-style-ish.
If you're really ok with minimalism, I'm writing such a library
https://filebin.net/7gtyh5j01gk1ofly
I
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote:
XMM registers work, but as soon as they are changed into YMM
DMD outputs "bad type/size of operands %s" and LDC outputs an
"label YMM0 is undefined" error. Are they not supported?
To illutrate : https://run.dlang.io/is/IqDHlK
By the way, how
On Friday, 5 March 2021 at 15:54:37 UTC, Paul Backus wrote:
The website is *supposed* to keep documentation for old
versions around, and allow you to select them using the
drop-down menu at the top-right:
note that in some cases my website lets you pull old versions too:
On Friday, 5 March 2021 at 03:32:35 UTC, harakim wrote:
That was pretty sweet. However, it kind of goes to the point of
my post. A one-revision difference means the documentation is
not accurate for my compiler.
I'm not saying the language shouldn't evolve, I'm just saying
it might make
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote:
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the
latest compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need
this for name of
XMM registers work, but as soon as they are changed into YMM DMD
outputs "bad type/size of operands %s" and LDC outputs an "label
YMM0 is undefined" error. Are they not supported?
To illutrate : https://run.dlang.io/is/IqDHlK
By the way, how can i use instructions that are not listed in
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote:
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the
latest compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need
this for name of
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the latest
compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need this
for name of type string
source/introspection/type.d(156,13): Error:
42 matches
Mail list logo