July 30, 2003 Crash when allocating >65K objects | ||||
---|---|---|---|---|
| ||||
It's probably something dumb in my setup, but just in case, here's a simple bug I've run into. I was trying to benchmark GC, but anything that allocates over about 65K objects crashes. Here's a simple example: class Foo { int a, b, c; } int main(char[][] args) { Foo foo; int i; for(i = 0; i < 100000; i++) { printf("i = %d\n", i); foo = new Foo; } return 0; } When I run it, it crashes with the last output looking like: i = 65148 i = 65149 i = 65150 i = 65151 Segmentation fault |
July 30, 2003 Re: Crash when allocating >65K objects | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Cox | Bill Cox wrote:
> It's probably something dumb in my setup, but just in case, here's a simple bug I've run into.
>
> I was trying to benchmark GC, but anything that allocates over about 65K objects crashes. Here's a simple example:
>
> class Foo {
> int a, b, c;
> }
>
> int main(char[][] args)
> {
> Foo foo;
> int i;
>
> for(i = 0; i < 100000; i++) {
> printf("i = %d\n", i);
> foo = new Foo;
> }
> return 0;
> }
Works for me. Make sure you've got DMD 0.68.
|
Copyright © 1999-2021 by the D Language Foundation