Re: Uninitialized object hangs without warning.

2014-11-26 Thread Bear Cherian via Digitalmars-d-learn
On Wednesday, 26 November 2014 at 09:38:11 UTC, bearophile wrote: Bear Cherian: Class MyClass{ this(){} void someFunction(){ //body } } And in my app I had something like MyClass classObject; classObject.someFunction(); When I compile, no warnings or errors

Uninitialized object hangs without warning.

2014-11-25 Thread Bear Cherian via Digitalmars-d-learn
I ran into this a while ago and have already moved on, but I had a class such as this Class MyClass{ this(){} void someFunction(){ //body } } And in my app I had something like MyClass classObject; classObject.someFunction(); When I compile, no warnings or

Void initialization

2011-12-19 Thread Bear
Using D1, I have a program that creates tons of float[] ; for performance reasons, I would like them to be uninitialized. I've tried replacing float[] f = new float[x]; by float[] f = cast(float[])std.gc.malloc(x*4); Unfortunately I keep running into Access violation and sometimes Array bounds

Re: Void initialization

2011-12-19 Thread Bear
gc.malloc actually returns void[] Bearophile's suggestion seems to work though, but it doesn't seem to improve performance for some reason... I guess I'll have to find some other way to make my prog quicker.