Documentation bugs

Walter Bright newshound at digitalmars.com
Tue Mar 7 16:32:11 PST 2006


"Jari-Matti Mäkelä" <jmjmak at utu.fi.invalid> wrote in message 
news:dul6sh$30eu$1 at digitaldaemon.com...
> 4. One other question - what are the hard limits of DMD?

There aren't any, other than identifier length limits.

> For example,
> how many objects of a class can be instantiated at most?

Limited by memory the os can provide.

> We have made a
> suffix tree -algorithm that generates a huge amount of objects. I think
> the compiler introduces some limits, since the algorithm segfaults only
> after about >300 identical successful runs - the amount of successful
> identical runs before segfault decreases when the tree depth increases.
> It segfaults on the following code:
>
> class Node {
>  Node[char] children;
>  char[] label;
>
>  void fn(char[] s) {
>    assert(s !is null);
>    assert(s.length > 0);
>    assert(s[0] in children);
>    auto a = children[s[0]];
>    assert(a !is null);
>    char[] l = a.label;  // segfault exactly here
>    assert(l != null);
>    ...
>  }
> }
>
> The segfault shouldn't be possible since all objects all guaranteed to
> be properly allocated from the heap. We don't use any explicit memory
> management. I can post the whole source if needs be.

I'd start adding in more asserts to track it down. 





More information about the Digitalmars-d-bugs mailing list