On Saturday, 5 December 2015 at 21:49:52 UTC, Ralf wrote:
Hi,
I've written several small command-line utilities in D that are
to be shipped together in one package. Each one of them only
would be only a few kB in size, but they end up being ~1Mb, I
assume because every one links statically
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote:
I want to create a static array large enough to store 1MB of
float values.
What am I doing wrong?
Here is a sample code with notes:
void main(string[] args) {
enum size_t COUNT = 1024 * 512 / float.sizeof; // works OK :)
On 12/5/15 8:09 AM, John Colvin wrote:
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote:
I want to create a static array large enough to store 1MB of float
values.
What am I doing wrong?
Here is a sample code with notes:
void main(string[] args) {
enum size_t COUNT = 1024 * 512
On 12/05/2015 01:32 AM, Observer wrote:
Won't clear(c); do the trick? ((pp187-188 of TDPL)
clear() has been renamed as destroy() but it won't work by itself
because the OP wants a reusable object. I think, in addition to
destroy(), the default constructor should be run:
On Sat, 05 Dec 2015 07:48:16 -0800, Ali Çehreli wrote:
> On 12/05/2015 01:32 AM, Observer wrote:
>
>> Won't clear(c); do the trick? ((pp187-188 of TDPL)
>
> clear() has been renamed as destroy() but it won't work by itself
> because the OP wants a reusable object. I think, in addition to
>
On Saturday, 5 December 2015 at 16:28:18 UTC, Chris Wright wrote:
The default constructor doesn't set default field values,
though, which is why my solution involved copying
ClassInfo.init.
Thanks, this is a handy factoid. Reminds me of the whole __dtor
vs __xdtor debacle.
On Friday, 4 December 2015 at 14:06:26 UTC, Alex wrote:
[...]
hoping it would be faster. This was not the case. Why?
[...]
Is there anything else to improve performance significantly?
Profile. Profile profile profile. Callgrind. Find bottlenecks
instead of guessing them.
On Saturday, 5 December 2015 at 21:49:52 UTC, Ralf wrote:
I've written several small command-line utilities in D that are
to be shipped together in one package.
I'm not sure if shared lib support is on Mac or not (I know it is
on Linux but mac is different...).
But do they need to actually
Hi,
I try to parse some hexadecimal numbers stocked in a string. So I
use this code
---
import std.conv;
string s = "B";
int value = parse!int(s, 16);
assert(value == 11);
---
But when I have several hexadecimal numbers in the string, and I
slice it, the compiler can't deduce which
On Saturday, 5 December 2015 at 22:05:11 UTC, anonymous wrote:
You can use std.conv.to instead or assign the slice to a
variable first.
This is a bit of a FAQ I think because people don't realize you
can use to and parse to do the same thing.
The big difference is parse will advance the
I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20
which mentions:
"Calls to the druntime invariant handler are emitted in release
build also and there is no way to turn them off. Even if the
class does not have any invariants the invariant handler will
always be called, walk
On 12/5/15 6:06 PM, Andrew LaChance wrote:
I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which
mentions:
"Calls to the druntime invariant handler are emitted in release build
also and there is no way to turn them off. Even if the class does not
have any invariants the
On 12/5/15 6:54 PM, Chris Wright wrote:
I've never used a release build of anything. Bounds checking isn't that
expensive.
void main()
{
int[] arr = new int[10];
assert(arr.capacity == 1000); // obviously wrong
arr[10] = 5;
}
dmd -release -boundscheck=on testboundscheck.d
On Sat, 05 Dec 2015 23:06:22 +, Andrew LaChance wrote:
> I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which
> mentions:
>
> "Calls to the druntime invariant handler are emitted in release build
> also and there is no way to turn them off. Even if the class does not
>
On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote:
Given
class C
{
// lots of members
}
and a function
f(C c)
{
}
is there a generic way, perhaps through reflection, to reset
(inside f) all members of `c` to their default values?
Something along
I want to create a static array large enough to store 1MB of
float values.
What am I doing wrong?
Here is a sample code with notes:
void main(string[] args) {
enum size_t COUNT = 1024 * 512 / float.sizeof; // works OK :)
//enum size_t COUNT = 1024 * 512 * 2 / float.sizeof; //
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote:
I want to create a static array large enough to store 1MB of
float values.
What am I doing wrong?
Here is a sample code with notes:
void main(string[] args) {
enum size_t COUNT = 1024 * 512 / float.sizeof; // works OK :)
On 05.12.2015 01:40, Alex wrote:
found and tried out the -vgc option...
Is there a way to deactivate the GC, if it stands in way?
You can call core.memory.GC.disable to disable automatic collections.
.enable to turn them on again.
http://dlang.org/phobos/core_memory.html#.GC
Yes, I
Hi,
I've written several small command-line utilities in D that are
to be shipped together in one package. Each one of them only
would be only a few kB in size, but they end up being ~1Mb, I
assume because every one links statically parts of the standard
library.
How can this be improved?
On Saturday, 5 December 2015 at 22:05:11 UTC, anonymous wrote:
On 05.12.2015 22:59, Quentin Ladeveze wrote:
---
import std.conv;
string s = "1B2A";
int value = parse!int(s[0..2], 16); //template std.conv.parse
cannot
deduce function from argument types !(int)(string, int)
---
Does someone
On 05.12.2015 22:59, Quentin Ladeveze wrote:
---
import std.conv;
string s = "1B2A";
int value = parse!int(s[0..2], 16); //template std.conv.parse cannot
deduce function from argument types !(int)(string, int)
---
Does someone have an idea of why it happens ? The version of parse that
is used
21 matches
Mail list logo