Documentation bugs
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Tue Mar 7 16:08:11 PST 2006
1. The following anchor does not work. There is one # too much.
http://www.digitalmars.com/d/faq.html#real
2. There's no mention about class templates
(e.g. class foo(type) { ... }) on
http://www.digitalmars.com/d/class.html
3. There aren't any examples of classes that inherit from super classes
/ interfaces with protection attributes. In fact I don't even know how
and why they should work (maybe the way C++ uses them?). E.g.
class foo : private bar { ... }
Walter, please don't go the c++ way here. That would make the current
interfaces totally useless. E.g.
interface foo { void fn(); }
class bar : private foo { private void fn() { ..implementation.. } }
foo a = new bar();
a.fn();
would become illegal.
4. One other question - what are the hard limits of DMD? For example,
how many objects of a class can be instantiated at most? 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.
--
Jari-Matti
More information about the Digitalmars-d-bugs
mailing list