On Tuesday, 27 January 2015 at 15:45:47 UTC, bearophile wrote:
Gan:
How can I make it use less CPU/RAM?
Most tiny classes probably should be structs. More generally,
use a struct every time you don't need a class.
You can start with those two:
struct SBRange {
double left = 0.0,
Gan:
Is there some special stuff I gotta do extra with structs? Do
they need manually allocated and released?
Most of your usages of tiny structs should be by value. So just
keep in mind they are values. Even when you iterate with a
foreach on a mutable array of them :-)
On a second
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
Gan:
Is there some special stuff I gotta do extra with structs? Do
they need manually allocated and released?
Most of your usages of tiny structs should be by value. So just
keep in mind they are values. Even when you iterate
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
Gan:
Is there some special stuff I gotta do extra with structs? Do
they need manually allocated and released?
Most of your usages of tiny structs should be by value. So
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
Gan:
Is there some special stuff I gotta do extra with structs? Do they
need manually allocated and released?
Most of your usages of
On 28/01/2015 11:30 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote:
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
Gan:
Is there some special
On Tuesday, 27 January 2015 at 22:30:13 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole
wrote:
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile
wrote:
Gan:
Is
On Tuesday, 27 January 2015 at 22:39:31 UTC, Gan wrote:
Would you know why this is using hundreds of mb of rams?
Hi,
What type is CircleShape?
If it is a class, or otherwise contains pointers, then this is
probably the source of your problem.
You are storing high-entropy data
On 2015-01-27 at 23:39, Gan wrote:
I commented out some stuff and it appears my massive memory consumption comes
from my tile.redraw function:
...
Would you know why this is using hundreds of mb of rams?
Looks OK, so probably it is not the cause by itself.
I would add a piece of code to
On 28/01/2015 11:39 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 22:30:13 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote:
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at
On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole
wrote:
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
Gan:
Is there some special stuff I gotta do extra with structs?
Do
On Tuesday, 27 January 2015 at 22:42:25 UTC, Rikki Cattermole
wrote:
On 28/01/2015 11:39 a.m., Gan wrote:
On Tuesday, 27 January 2015 at 22:30:13 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole
wrote:
On 28/01/2015 9:59 a.m., Gan wrote:
On Tuesday, 27 January
On 2015-01-28 at 03:04, Vladimir Panteleev wrote:
What type is CircleShape?
If it is a class, or otherwise contains pointers, then this is probably the
source of your problem.
class CircleShape : Shape is defined in dsfml.graphics.circleshape, so there's
no going around this...
- Building
On Wednesday, 28 January 2015 at 02:50:11 UTC, FG wrote:
On 2015-01-28 at 03:04, Vladimir Panteleev wrote:
What type is CircleShape?
If it is a class, or otherwise contains pointers, then this is
probably the source of your problem.
class CircleShape : Shape is defined in
I feel like the only way I can get better right now is if someone
with more knowledge can give me some advice on the code I have
written.
Here's the link: http://cl.ly/0s0Q1L1S3v0E
How can I make it use less CPU/RAM?
(Most code is in the Misc/SpaceBackground.d)
Gan:
How can I make it use less CPU/RAM?
Most tiny classes probably should be structs. More generally, use
a struct every time you don't need a class.
You can start with those two:
struct SBRange {
double left = 0.0, right = 0.0, top = 0.0, bottom = 0.0;
}
struct Point(T) {
T x,
16 matches
Mail list logo