Re: Can somebody explain this memory usage

2009-04-01 Thread Saaa
I forgot to mention it is about a program I made :D (not the compiler itself or something) > dmd 1.042 Phobos OpenGl + SDL (Derelict) > > mem usage (winxp task manager) = 60MB, peak = 120MB > gc.fullCollect is run just before mainloop, no change in mem usage > > after 10 minutes or so mem usage h

Can somebody explain this memory usage

2009-04-01 Thread Saaa
dmd 1.042 Phobos OpenGl + SDL (Derelict) mem usage (winxp task manager) = 60MB, peak = 120MB gc.fullCollect is run just before mainloop, no change in mem usage after 10 minutes or so mem usage has stabilized at 70MB I have localized this to toStringz usage and think this is why tango's toString

Re: New to D: Building multiple files

2009-04-01 Thread Jesse Phillips
On Sun, 29 Mar 2009 17:43:51 +0200, torhu wrote: > On 29.03.2009 17:04, chris wrote: >> Alright so I'm not too familiar with building D or having to build >> multiple files from the command line (Java usually takes care of that). >> Basically I have a small game I put together as a test project.

Re: What's the purpose of the -v1 switch?

2009-04-01 Thread Jarrett Billingsley
On Wed, Apr 1, 2009 at 1:22 PM, grauzone wrote: > Jarrett Billingsley wrote: >> >> On Wed, Apr 1, 2009 at 12:01 PM, Trass3r wrote: >>> >>> I mean it can only be used with dmd 1.x compilers anyway. >>> >>> else if (strcmp(p + 1, "v1") == 0) >>> { >>> #if DMDV1 >>>       global.params.Dversion = 1;

Re: What's the purpose of the -v1 switch?

2009-04-01 Thread grauzone
Jarrett Billingsley wrote: On Wed, Apr 1, 2009 at 12:01 PM, Trass3r wrote: I mean it can only be used with dmd 1.x compilers anyway. else if (strcmp(p + 1, "v1") == 0) { #if DMDV1 global.params.Dversion = 1; #else error("use DMD 1.0 series compilers for -v1 switch"); break

Re: What's the purpose of the -v1 switch?

2009-04-01 Thread Jarrett Billingsley
On Wed, Apr 1, 2009 at 12:01 PM, Trass3r wrote: > I mean it can only be used with dmd 1.x compilers anyway. > > else if (strcmp(p + 1, "v1") == 0) > { > #if DMDV1 >        global.params.Dversion = 1; > #else >        error("use DMD 1.0 series compilers for -v1 switch"); >        break; > #endif >

What's the purpose of the -v1 switch?

2009-04-01 Thread Trass3r
I mean it can only be used with dmd 1.x compilers anyway. else if (strcmp(p + 1, "v1") == 0) { #if DMDV1 global.params.Dversion = 1; #else error("use DMD 1.0 series compilers for -v1 switch"); break; #endif }

Re: project euler #10: optimization with primes

2009-04-01 Thread Tiago Carvalho
"Michael P." wrote in message news:gqvksi$1r...@digitalmars.com... Spacen Jasset Wrote: Michael P. wrote: > Hey, I've started to do some of the problems on Project Euler to > practice my programming skills. I'm doing #10 right now, and I think > I've got a working solution. It's just that

Re: project euler #10: optimization with primes

2009-04-01 Thread Don
Michael P. wrote: Spacen Jasset Wrote: Michael P. wrote: Hey, I've started to do some of the problems on Project Euler to practice my programming skills. I'm doing #10 right now, and I think I've got a working solution. It's just that it's way too slow. Here's the link: http://projecteuler.n

Re: project euler #10: optimization with primes

2009-04-01 Thread Michael P.
Spacen Jasset Wrote: > Michael P. wrote: > > Hey, I've started to do some of the problems on Project Euler to practice > > my programming skills. I'm doing #10 right now, and I think I've got a > > working solution. It's just that it's way too slow. > > Here's the link: > > http://projecteuler.n

Re: project euler #10: optimization with primes

2009-04-01 Thread bearophile
Robert Fraser Wrote: > Yeah that's shorter (vertically; it's almost as long in characters), This is simpler and faster (runs in 2.19 seconds), and gives the same result, xtakeWhile isn't required because xprimes already stops nicely when the given max N is reached: import d.func, d.primes, d.st

Re: project euler #10: optimization with primes

2009-04-01 Thread Daniel Keep
Robert Fraser wrote: > bearophile wrote: >> import d.func, d.primes, d.string; >> void main() { >> const int N = 1_000_000_000; >> putr( sum(xtakeWhile((int i){ return i < N;}, xprimes(N))) ); >> } > > Yeah that's shorter (vertically; it's almost as long in characters), but > how much li

Re: project euler #10: optimization with primes

2009-04-01 Thread Robert Fraser
bearophile wrote: import d.func, d.primes, d.string; void main() { const int N = 1_000_000_000; putr( sum(xtakeWhile((int i){ return i < N;}, xprimes(N))) ); } Yeah that's shorter (vertically; it's almost as long in characters), but how much lisp do you have to smoke to understand it?

Re: project euler #10: optimization with primes

2009-04-01 Thread Spacen Jasset
Michael P. wrote: Hey, I've started to do some of the problems on Project Euler to practice my programming skills. I'm doing #10 right now, and I think I've got a working solution. It's just that it's way too slow. Here's the link: http://projecteuler.net/index.php?section=problems&id=10 The co