nothrow functions/methods

2010-02-28 Thread bearophile
Before filing a possible bug report I prefer to ask here, because my ideas are often wrong. This is a small D2 program: nothrow void foo() { // auto a = new int[5]; // not allowed here int[int] aa; for (int i; i < 100_000_000; i++) aa[i] = i; } void main() { foo(); } Insi

Re: nothrow functions/methods

2010-02-28 Thread Daniel Murphy
bearophile Wrote: > Before filing a possible bug report I prefer to ask here, because my ideas > are often wrong. > This is a small D2 program: > > nothrow void foo() { > // auto a = new int[5]; // not allowed here > int[int] aa; > for (int i; i < 100_000_000; i++) > aa[i] =

Re: nothrow functions/methods

2010-02-28 Thread bearophile
Daniel Murphy: > Allocations are allowed inside nothrow functions. If I remember correctly, > the reasons are that disallowing them would limit usefulness, and that > OutOfMemoryError is not generally recoverable.< OK. Then can you tell me why the following program produces: test2.d(1): Error:

Re: nothrow functions/methods

2010-02-28 Thread Don
bearophile wrote: Daniel Murphy: Allocations are allowed inside nothrow functions. If I remember correctly, the reasons are that disallowing them would limit usefulness, and that OutOfMemoryError is not generally recoverable.< OK. Then can you tell me why the following program produces: tes

Re: nothrow functions/methods

2010-02-28 Thread bearophile
Don: > That's clearly a bug. Thank you for your answer Don. http://d.puremagic.com/issues/show_bug.cgi?id=3864 (In future I will even start trying to fix them.) Bye, bearophile