@@ -89,10 +89,16 @@ - initWithSerialization: (OFXMLElement*)element { return (id)[[OFMutableDictionary_hashtable alloc] initWithSerialization: element]; } + +- initWithCapacity: (size_t)capacity +{ + return (id)[[OFMutableDictionary_hashtable alloc] + initWithCapacity: capacity]; +} - retain { return self; } @@ -128,10 +134,15 @@ if (self == [OFMutableDictionary class]) return (id)&placeholder; return [super alloc]; } + ++ dictionaryWithCapacity: (size_t)capacity +{ + return [[[self alloc] initWithCapacity: capacity] autorelease]; +} - init { if (object_getClass(self) == [OFMutableDictionary class]) { @try { @@ -143,10 +154,21 @@ } } return [super init]; } + +- initWithCapacity: (size_t)capacity +{ + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } +} - (void)setObject: (id)object forKey: (id)key { [self doesNotRecognizeSelector: _cmd];