On 06/23/2014 10:03 PM, David Zaragoza wrote: Hello
I'm trying to compile the following program:
module main;
int main(string[] argv){
short asd = 1;
short qwe = asd + asd;
return 0;
}
And the compiler gives this error:
C:\Daviddmd simple
simple.d(5): Error: cannot
h_zet:
Problem solved, Thank you so much!
I don't think it's solved. There are probably bugs worth
reporting here.
Bye,
bearophile
I'm getting OutOfMemoryErrors on some machines when calling
GC.malloc (or new) for anything large (more than about 1GB),
where core.stdc.malloc works fine.
Anyone ever come accross this before? I suspect it's related to
some system memory monitor/management as it's only happening to
me on
If I compile with rdmd
```
$ dub build --rdmd
```
it works
I don't think it's solved. There are probably bugs worth
reporting here.
I have not found them, sorry for the noise.
Bye,
bearophile
On Tuesday, 24 June 2014 at 10:06:10 UTC, John Colvin wrote:
I'm getting OutOfMemoryErrors on some machines when calling
GC.malloc (or new) for anything large (more than about 1GB),
where core.stdc.malloc works fine.
Anyone ever come accross this before? I suspect it's related to
some system
John Colvin:
I'm getting OutOfMemoryErrors on some machines when calling
GC.malloc (or new) for anything large (more than about 1GB),
where core.stdc.malloc works fine.
I think that when you go in territories where most people have
not done much coding in D, like allocating than 1 GB in one
On Tuesday, 24 June 2014 at 04:37:56 UTC, Rikki Cattermole wrote:
On 24/06/2014 1:13 p.m., Jason King wrote:
This is me trying to link with Juno and getting tantalizingly
close to
success.
DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on
path)
Juno is in
On 25/06/2014 12:34 a.m., Jason King wrote:
On Tuesday, 24 June 2014 at 04:37:56 UTC, Rikki Cattermole wrote:
On 24/06/2014 1:13 p.m., Jason King wrote:
This is me trying to link with Juno and getting tantalizingly close to
success.
DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on
I don't know enough about implib to explain it.
But another method that I believe should work is to use linker
definition files.
It'll allow optlink to work.
Just add it to dmd, actually I believe it needs to be passed to
Optlink (so -L it).
Another fix, might be to use 64bit, but shouldn't
On Tuesday, 24 June 2014 at 10:11:05 UTC, bearophile wrote:
I don't think it's solved. There are probably bugs worth
reporting here.
I have not found them, sorry for the noise.
Bye,
bearophile
This looks really bad. I thought we weren't going to allow
variable templates, just enums and
Hello,
I need to use the popcnt processor instruction in a performance
critical section.
Is there a way to do this in D?
On Tue, 24 Jun 2014 16:34:42 +, Archibald wrote:
Hello,
I need to use the popcnt processor instruction in a performance
critical section.
Is there a way to do this in D?
D's inline assembler is described here: http://dlang.org/iasm.html
On Tuesday, 24 June 2014 at 17:05:24 UTC, Justin Whear wrote:
On Tue, 24 Jun 2014 16:34:42 +, Archibald wrote:
Hello,
I need to use the popcnt processor instruction in a
performance
critical section.
Is there a way to do this in D?
D's inline assembler is described here:
Hi, I like to print the strings from a C function that returns
const(dchar*), but I can't make the conversion to dstring. I can
convert vice versa by:
dstring text = Hello;
const(dchar)* str = toUTFz!(const(dchar)*)(text);
// passing it to C function prints Hello
However, I don't have the
On Tue, 24 Jun 2014 13:37:41 -0400, Danyal Zia catofdan...@yahoo.com
wrote:
Hi, I like to print the strings from a C function that returns
const(dchar*), but I can't make the conversion to dstring. I can convert
vice versa by:
dstring text = Hello;
const(dchar)* str =
How can I free the memory used by an associative array?
I need to be able to reuse the same array, but set it to an empty
state and free up the memory it used previously.
I do not believe that setting the associative array to null is
sufficient to free the memory, as it is possible that someone
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer
wrote:
const(dchar *)x = ...;
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
-Steve
const(dchar)* x = Hello\0;
dstring text = x[0..x.strlen].idup;
writeln(text);
Error: no property 'strlen' for type 'const(dchar)*'
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer
wrote:
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
strlen is only defined for char, not dchar:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/string.d#L44
On Tuesday, 24 June 2014 at 18:17:07 UTC, Danyal Zia wrote:
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer
wrote:
const(dchar *)x = ...;
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
-Steve
const(dchar)* x = Hello\0;
dstring text = x[0..x.strlen].idup;
On Tue, 24 Jun 2014 18:17:06 +, Danyal Zia wrote:
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer wrote:
const(dchar *)x = ...;
// assuming 0 terminated dstring text = x[0..x.strlen].idup;
-Steve
const(dchar)* x = Hello\0;
dstring text = x[0..x.strlen].idup;
On Tuesday, 24 June 2014 at 18:34:31 UTC, Chris Cain wrote:
You can do what he said, but you'll have to write your own
strlen function:
something like:
size_t strlen(in dchar* s) pure @system nothrow
{
size_t pos = 0;
dchar term = '\0';
while(s[pos] != term)
On 2014-06-24 04:34, John Carter wrote:
So in Ruby and R and Scheme and... I have happily used map / collect for
years and years.
Lovely thing.
So I did the dumb obvious of
string[] stringList = map!...;
And D barfed, wrong type, some evil voldemort thing again.
So..
auto
On Tue, 24 Jun 2014 14:28:58 -0400, Chris Cain zsh...@gmail.com wrote:
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer wrote:
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
strlen is only defined for char, not dchar:
Sent: Tuesday, June 24, 2014 at 11:12 AM
From: Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
To: digitalmars-d-learn@puremagic.com
Subject: How to free memory of an associative array
How can I free the memory used by an associative array?
I need to be able to
Yes, the final callback is always called, but if an error is passed to the
callback by any of the main steps in the sequence ladder, it will
immediately jump to the final callback and not execute further steps.
OK.
What do you mean? The compiler does deduce the type of Funcs.
If you look
On Tuesday, 24 June 2014 at 17:27:09 UTC, Rene Zwanenburg wrote:
On Tuesday, 24 June 2014 at 17:05:24 UTC, Justin Whear wrote:
On Tue, 24 Jun 2014 16:34:42 +, Archibald wrote:
Hello,
I need to use the popcnt processor instruction in a
performance
critical section.
Is there a way to do
On Tue, 24 Jun 2014 19:44:52 +, Archibald wrote:
Thanks for the answers.
Unfortunately it seems like popcnt isn't supported by D's inline
assembler.
What if I import it as an external C function, will I get optimal
performance?
DMD 2.065 seems to support it. What compiler are you using
Also, see:
http://forum.dlang.org/thread/alirjgygnwpifkijx...@forum.dlang.org
On 6/24/14, 4:13 PM, Jacob Carlborg wrote:
On 2014-06-24 04:34, John Carter wrote:
So in Ruby and R and Scheme and... I have happily used map / collect for
years and years.
Lovely thing.
So I did the dumb obvious of
string[] stringList = map!...;
And D barfed, wrong type, some evil
On Tuesday, 24 June 2014 at 19:56:29 UTC, Justin Whear wrote:
Also, see:
http://forum.dlang.org/thread/alirjgygnwpifkijx...@forum.dlang.org
its not documented on the inline assembler page.
That's why I thought it wasn't supported, it's not in the list of
supported opcodes.
Thanks for the
I opened new issue: https://issues.dlang.org/show_bug.cgi?id=12986
On Tue, 24 Jun 2014 21:46:15 +, kuba wrote:
Hi there,
I was wondering if std.algorithm.map can take functions with
parameters passed by reference? The main point here is to avoid
unnecessary copies by perhaps I'm using the wrong tool for the
job.
No, `map` is a _projection_ function
On Tuesday, 24 June 2014 at 21:46:16 UTC, kuba wrote:
The main point here is to avoid unnecessary copies
You should make sure this actually matters - passing doubles by
ref for example is probably slower than just passing a regular
double.
Interesting info, I've never seen this behavior in C since the
conversion is implicit as [2] notes. A simple cast resolves the
problem in D:
module main;
int main(string[] argv){
short asd = 1;
short qwe = cast(short)(asd + asd);
return 0;
}
Thanks for your answer :)
On 6/25/2014 10:10 AM, Yuushi wrote:
I was wondering if D had something akin to std::function in C++.
Say I have some functions in an associative array, for example:
auto mapping = ['!' : (string a) = toUpper!string(a), '^' :
(string a) = capitalize!string(a)];
What I want to do is
I open a command line window, and run the following 6 line program
void main()
{
string envPath = environment[PATH];
writeln(PATH is: , envPath);
envPath ~= r;F:\dmd2\windows\bin;
environment[PATH] = envPath;
envPath = environment[PATH];
writeln(PATH is: , envPath);
}
It
On Wednesday, 25 June 2014 at 01:47:13 UTC, Mike Parker wrote:
On 6/25/2014 10:45 AM, Mike Parker wrote:
On 6/25/2014 10:10 AM, Yuushi wrote:
I was wondering if D had something akin to std::function in
C++.
Say I have some functions in an associative array, for
example:
auto mapping
On Wednesday, 25 June 2014 at 03:33:15 UTC, Yuushi wrote:
Thanks a ton - I guess I need to do a fair bit more reading
about alias.
In this case, alias acts as typedef in C++. What is important
here is the function pointers/delegates syntax.
39 matches
Mail list logo