| ︙ | | | ︙ | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"
#define MIN_CAPACITY 16
struct of_map_table_bucket {
void *key, *object;
unsigned long hash;
};
static struct of_map_table_bucket deleted = { 0 };
static void *
defaultRetain(void *object)
{
return object;
}
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#import "OFEnumerationMutationException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"
#define MIN_CAPACITY 16
struct OFMapTableBucket {
void *key, *object;
unsigned long hash;
};
static struct OFMapTableBucket deleted = { 0 };
static void *
defaultRetain(void *object)
{
return object;
}
|
| ︙ | | | ︙ | |
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
{
return (object1 == object2);
}
OF_DIRECT_MEMBERS
@interface OFMapTableEnumerator ()
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct of_map_table_bucket **)buckets
capacity: (unsigned long)capacity
mutationsPointer: (unsigned long *)mutationsPtr
OF_METHOD_FAMILY(init);
@end
@interface OFMapTableKeyEnumerator: OFMapTableEnumerator
@end
@interface OFMapTableObjectEnumerator: OFMapTableEnumerator
@end
@implementation OFMapTable
@synthesize keyFunctions = _keyFunctions, objectFunctions = _objectFunctions;
+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions
objectFunctions: (of_map_table_functions_t)
objectFunctions
{
return [[[self alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions] autorelease];
}
+ (instancetype)mapTableWithKeyFunctions: (of_map_table_functions_t)keyFunctions
objectFunctions: (of_map_table_functions_t)
objectFunctions
capacity: (size_t)capacity
{
return [[[self alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions
capacity: capacity] autorelease];
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions
objectFunctions: (of_map_table_functions_t)objectFunctions
{
return [self initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions
capacity: 0];
}
- (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions
objectFunctions: (of_map_table_functions_t)objectFunctions
capacity: (size_t)capacity
{
self = [super init];
@try {
_keyFunctions = keyFunctions;
_objectFunctions = objectFunctions;
|
|
|
<
|
|
<
|
|
|
|
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
{
return (object1 == object2);
}
OF_DIRECT_MEMBERS
@interface OFMapTableEnumerator ()
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct OFMapTableBucket **)buckets
capacity: (unsigned long)capacity
mutationsPointer: (unsigned long *)mutationsPtr
OF_METHOD_FAMILY(init);
@end
@interface OFMapTableKeyEnumerator: OFMapTableEnumerator
@end
@interface OFMapTableObjectEnumerator: OFMapTableEnumerator
@end
@implementation OFMapTable
@synthesize keyFunctions = _keyFunctions, objectFunctions = _objectFunctions;
+ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions
objectFunctions: (OFMapTableFunctions)objectFunctions
{
return [[[self alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions] autorelease];
}
+ (instancetype)mapTableWithKeyFunctions: (OFMapTableFunctions)keyFunctions
objectFunctions: (OFMapTableFunctions)objectFunctions
capacity: (size_t)capacity
{
return [[[self alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions
capacity: capacity] autorelease];
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions
objectFunctions: (OFMapTableFunctions)objectFunctions
{
return [self initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions
capacity: 0];
}
- (instancetype)initWithKeyFunctions: (OFMapTableFunctions)keyFunctions
objectFunctions: (OFMapTableFunctions)objectFunctions
capacity: (size_t)capacity
{
self = [super init];
@try {
_keyFunctions = keyFunctions;
_objectFunctions = objectFunctions;
|
| ︙ | | | ︙ | |
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
if (capacity * 8 / _capacity >= 6)
if (_capacity <= ULONG_MAX / 2)
_capacity *= 2;
if (_capacity < MIN_CAPACITY)
_capacity = MIN_CAPACITY;
_buckets = of_alloc_zeroed(_capacity, sizeof(*_buckets));
if (of_hash_seed != 0)
_rotate = of_random16() & 31;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
for (unsigned long i = 0; i < _capacity; i++) {
if (_buckets[i] != NULL && _buckets[i] != &deleted) {
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
free(_buckets[i]);
}
}
free(_buckets);
[super dealloc];
}
static void
resizeForCount(OFMapTable *self, unsigned long count)
{
unsigned long fullness, capacity;
struct of_map_table_bucket **buckets;
if (count > ULONG_MAX / sizeof(*self->_buckets) ||
count > ULONG_MAX / 8)
@throw [OFOutOfRangeException exception];
fullness = count * 8 / self->_capacity;
|
|
|
|
|
|
|
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
if (capacity * 8 / _capacity >= 6)
if (_capacity <= ULONG_MAX / 2)
_capacity *= 2;
if (_capacity < MIN_CAPACITY)
_capacity = MIN_CAPACITY;
_buckets = OFAllocZeroedMemory(_capacity, sizeof(*_buckets));
if (OFHashSeed != 0)
_rotate = OFRandom16() & 31;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
for (unsigned long i = 0; i < _capacity; i++) {
if (_buckets[i] != NULL && _buckets[i] != &deleted) {
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
OFFreeMemory(_buckets[i]);
}
}
OFFreeMemory(_buckets);
[super dealloc];
}
static void
resizeForCount(OFMapTable *self, unsigned long count)
{
unsigned long fullness, capacity;
struct OFMapTableBucket **buckets;
if (count > ULONG_MAX / sizeof(*self->_buckets) ||
count > ULONG_MAX / 8)
@throw [OFOutOfRangeException exception];
fullness = count * 8 / self->_capacity;
|
| ︙ | | | ︙ | |
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
* Don't downsize if we have an initial capacity or if we would fall
* below the minimum capacity.
*/
if ((capacity < self->_capacity && count > self->_count) ||
capacity < MIN_CAPACITY)
return;
buckets = of_alloc_zeroed(capacity, sizeof(*buckets));
for (unsigned long i = 0; i < self->_capacity; i++) {
if (self->_buckets[i] != NULL &&
self->_buckets[i] != &deleted) {
unsigned long j, last;
last = capacity;
|
|
|
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
* Don't downsize if we have an initial capacity or if we would fall
* below the minimum capacity.
*/
if ((capacity < self->_capacity && count > self->_count) ||
capacity < MIN_CAPACITY)
return;
buckets = OFAllocZeroedMemory(capacity, sizeof(*buckets));
for (unsigned long i = 0; i < self->_capacity; i++) {
if (self->_buckets[i] != NULL &&
self->_buckets[i] != &deleted) {
unsigned long j, last;
last = capacity;
|
| ︙ | | | ︙ | |
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
if (j >= last)
@throw [OFOutOfRangeException exception];
buckets[j] = self->_buckets[i];
}
}
free(self->_buckets);
self->_buckets = buckets;
self->_capacity = capacity;
}
static void
setObject(OFMapTable *restrict self, void *key, void *object,
unsigned long hash)
{
unsigned long i, last;
void *old;
if (key == NULL || object == NULL)
@throw [OFInvalidArgumentException exception];
hash = OF_ROL(hash, self->_rotate);
last = self->_capacity;
for (i = hash & (self->_capacity - 1);
i < last && self->_buckets[i] != NULL; i++) {
if (self->_buckets[i] == &deleted)
continue;
|
|
|
|
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
if (j >= last)
@throw [OFOutOfRangeException exception];
buckets[j] = self->_buckets[i];
}
}
OFFreeMemory(self->_buckets);
self->_buckets = buckets;
self->_capacity = capacity;
}
static void
setObject(OFMapTable *restrict self, void *key, void *object,
unsigned long hash)
{
unsigned long i, last;
void *old;
if (key == NULL || object == NULL)
@throw [OFInvalidArgumentException exception];
hash = OFRotateLeft(hash, self->_rotate);
last = self->_capacity;
for (i = hash & (self->_capacity - 1);
i < last && self->_buckets[i] != NULL; i++) {
if (self->_buckets[i] == &deleted)
continue;
|
| ︙ | | | ︙ | |
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
}
}
/* Key not in map table */
if (i >= last || self->_buckets[i] == NULL ||
self->_buckets[i] == &deleted ||
!self->_keyFunctions.equal(self->_buckets[i]->key, key)) {
struct of_map_table_bucket *bucket;
resizeForCount(self, self->_count + 1);
self->_mutations++;
last = self->_capacity;
for (i = hash & (self->_capacity - 1); i < last &&
|
|
|
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
}
}
/* Key not in map table */
if (i >= last || self->_buckets[i] == NULL ||
self->_buckets[i] == &deleted ||
!self->_keyFunctions.equal(self->_buckets[i]->key, key)) {
struct OFMapTableBucket *bucket;
resizeForCount(self, self->_count + 1);
self->_mutations++;
last = self->_capacity;
for (i = hash & (self->_capacity - 1); i < last &&
|
| ︙ | | | ︙ | |
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
for (i = 0; i < last && self->_buckets[i] != NULL &&
self->_buckets[i] != &deleted; i++);
}
if (i >= last)
@throw [OFOutOfRangeException exception];
bucket = of_alloc(1, sizeof(*bucket));
@try {
bucket->key = self->_keyFunctions.retain(key);
} @catch (id e) {
free(bucket);
@throw e;
}
@try {
bucket->object = self->_objectFunctions.retain(object);
} @catch (id e) {
self->_keyFunctions.release(bucket->key);
free(bucket);
@throw e;
}
bucket->hash = hash;
self->_buckets[i] = bucket;
self->_count++;
|
|
|
|
|
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
for (i = 0; i < last && self->_buckets[i] != NULL &&
self->_buckets[i] != &deleted; i++);
}
if (i >= last)
@throw [OFOutOfRangeException exception];
bucket = OFAllocMemory(1, sizeof(*bucket));
@try {
bucket->key = self->_keyFunctions.retain(key);
} @catch (id e) {
OFFreeMemory(bucket);
@throw e;
}
@try {
bucket->object = self->_objectFunctions.retain(object);
} @catch (id e) {
self->_keyFunctions.release(bucket->key);
OFFreeMemory(bucket);
@throw e;
}
bucket->hash = hash;
self->_buckets[i] = bucket;
self->_count++;
|
| ︙ | | | ︙ | |
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
|
- (unsigned long)hash
{
unsigned long hash = 0;
for (unsigned long i = 0; i < _capacity; i++) {
if (_buckets[i] != NULL && _buckets[i] != &deleted) {
hash ^= OF_ROR(_buckets[i]->hash, _rotate);
hash ^= _objectFunctions.hash(_buckets[i]->object);
}
}
return hash;
}
- (id)copy
{
OFMapTable *copy = [[OFMapTable alloc]
initWithKeyFunctions: _keyFunctions
objectFunctions: _objectFunctions
capacity: _capacity];
@try {
for (unsigned long i = 0; i < _capacity; i++)
if (_buckets[i] != NULL && _buckets[i] != &deleted)
setObject(copy, _buckets[i]->key,
_buckets[i]->object,
OF_ROR(_buckets[i]->hash, _rotate));
} @catch (id e) {
[copy release];
@throw e;
}
return copy;
}
- (size_t)count
{
return _count;
}
- (void *)objectForKey: (void *)key
{
unsigned long i, hash, last;
if (key == NULL)
@throw [OFInvalidArgumentException exception];
hash = OF_ROL(_keyFunctions.hash(key), _rotate);
last = _capacity;
for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) {
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key))
|
|
|
|
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
|
- (unsigned long)hash
{
unsigned long hash = 0;
for (unsigned long i = 0; i < _capacity; i++) {
if (_buckets[i] != NULL && _buckets[i] != &deleted) {
hash ^= OFRotateRight(_buckets[i]->hash, _rotate);
hash ^= _objectFunctions.hash(_buckets[i]->object);
}
}
return hash;
}
- (id)copy
{
OFMapTable *copy = [[OFMapTable alloc]
initWithKeyFunctions: _keyFunctions
objectFunctions: _objectFunctions
capacity: _capacity];
@try {
for (unsigned long i = 0; i < _capacity; i++)
if (_buckets[i] != NULL && _buckets[i] != &deleted)
setObject(copy, _buckets[i]->key,
_buckets[i]->object,
OFRotateRight(_buckets[i]->hash, _rotate));
} @catch (id e) {
[copy release];
@throw e;
}
return copy;
}
- (size_t)count
{
return _count;
}
- (void *)objectForKey: (void *)key
{
unsigned long i, hash, last;
if (key == NULL)
@throw [OFInvalidArgumentException exception];
hash = OFRotateLeft(_keyFunctions.hash(key), _rotate);
last = _capacity;
for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) {
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key))
|
| ︙ | | | ︙ | |
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
- (void)removeObjectForKey: (void *)key
{
unsigned long i, hash, last;
if (key == NULL)
@throw [OFInvalidArgumentException exception];
hash = OF_ROL(_keyFunctions.hash(key), _rotate);
last = _capacity;
for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) {
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key)) {
_mutations++;
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
free(_buckets[i]);
_buckets[i] = &deleted;
_count--;
resizeForCount(self, _count);
return;
}
|
|
|
|
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
- (void)removeObjectForKey: (void *)key
{
unsigned long i, hash, last;
if (key == NULL)
@throw [OFInvalidArgumentException exception];
hash = OFRotateLeft(_keyFunctions.hash(key), _rotate);
last = _capacity;
for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) {
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key)) {
_mutations++;
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
OFFreeMemory(_buckets[i]);
_buckets[i] = &deleted;
_count--;
resizeForCount(self, _count);
return;
}
|
| ︙ | | | ︙ | |
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
|
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key)) {
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
free(_buckets[i]);
_buckets[i] = &deleted;
_count--;
_mutations++;
resizeForCount(self, _count);
return;
|
|
|
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
|
if (_buckets[i] == &deleted)
continue;
if (_keyFunctions.equal(_buckets[i]->key, key)) {
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
OFFreeMemory(_buckets[i]);
_buckets[i] = &deleted;
_count--;
_mutations++;
resizeForCount(self, _count);
return;
|
| ︙ | | | ︙ | |
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
|
_buckets[i] = NULL;
continue;
}
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
free(_buckets[i]);
_buckets[i] = NULL;
}
}
_count = 0;
_capacity = MIN_CAPACITY;
_buckets = of_realloc(_buckets, _capacity, sizeof(*_buckets));
/*
* Get a new random value for _rotate, so that it is not less secure
* than creating a new hash map.
*/
if (of_hash_seed != 0)
_rotate = of_random16() & 31;
}
- (bool)containsObject: (void *)object
{
if (object == NULL || _count == 0)
return false;
|
|
|
|
|
|
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
_buckets[i] = NULL;
continue;
}
_keyFunctions.release(_buckets[i]->key);
_objectFunctions.release(_buckets[i]->object);
OFFreeMemory(_buckets[i]);
_buckets[i] = NULL;
}
}
_count = 0;
_capacity = MIN_CAPACITY;
_buckets = OFResizeMemory(_buckets, _capacity, sizeof(*_buckets));
/*
* Get a new random value for _rotate, so that it is not less secure
* than creating a new hash map.
*/
if (OFHashSeed != 0)
_rotate = OFRandom16() & 31;
}
- (bool)containsObject: (void *)object
{
if (object == NULL || _count == 0)
return false;
|
| ︙ | | | ︙ | |
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
return [[[OFMapTableObjectEnumerator alloc]
of_initWithMapTable: self
buckets: _buckets
capacity: _capacity
mutationsPointer: &_mutations] autorelease];
}
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state
objects: (id *)objects
count: (int)count
{
unsigned long j = state->state;
int i;
for (i = 0; i < count; i++) {
|
|
|
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
|
return [[[OFMapTableObjectEnumerator alloc]
of_initWithMapTable: self
buckets: _buckets
capacity: _capacity
mutationsPointer: &_mutations] autorelease];
}
- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state
objects: (id *)objects
count: (int)count
{
unsigned long j = state->state;
int i;
for (i = 0; i < count; i++) {
|
| ︙ | | | ︙ | |
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
|
state->itemsPtr = objects;
state->mutationsPtr = &_mutations;
return i;
}
#ifdef OF_HAVE_BLOCKS
- (void)enumerateKeysAndObjectsUsingBlock:
(of_map_table_enumeration_block_t)block
{
bool stop = false;
unsigned long mutations = _mutations;
for (size_t i = 0; i < _capacity && !stop; i++) {
if (_mutations != mutations)
@throw [OFEnumerationMutationException
exceptionWithObject: self];
if (_buckets[i] != NULL && _buckets[i] != &deleted)
block(_buckets[i]->key, _buckets[i]->object, &stop);
}
}
- (void)replaceObjectsUsingBlock: (of_map_table_replace_block_t)block
{
unsigned long mutations = _mutations;
for (size_t i = 0; i < _capacity; i++) {
if (_mutations != mutations)
@throw [OFEnumerationMutationException
exceptionWithObject: self];
|
|
<
|
|
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
|
state->itemsPtr = objects;
state->mutationsPtr = &_mutations;
return i;
}
#ifdef OF_HAVE_BLOCKS
- (void)enumerateKeysAndObjectsUsingBlock: (OFMapTableEnumerationBlock)block
{
bool stop = false;
unsigned long mutations = _mutations;
for (size_t i = 0; i < _capacity && !stop; i++) {
if (_mutations != mutations)
@throw [OFEnumerationMutationException
exceptionWithObject: self];
if (_buckets[i] != NULL && _buckets[i] != &deleted)
block(_buckets[i]->key, _buckets[i]->object, &stop);
}
}
- (void)replaceObjectsUsingBlock: (OFMapTableReplaceBlock)block
{
unsigned long mutations = _mutations;
for (size_t i = 0; i < _capacity; i++) {
if (_mutations != mutations)
@throw [OFEnumerationMutationException
exceptionWithObject: self];
|
| ︙ | | | ︙ | |
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
|
@implementation OFMapTableEnumerator
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct of_map_table_bucket **)buckets
capacity: (unsigned long)capacity
mutationsPointer: (unsigned long *)mutationsPtr
{
self = [super init];
_mapTable = [mapTable retain];
_buckets = buckets;
|
|
|
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
|
@implementation OFMapTableEnumerator
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct OFMapTableBucket **)buckets
capacity: (unsigned long)capacity
mutationsPointer: (unsigned long *)mutationsPtr
{
self = [super init];
_mapTable = [mapTable retain];
_buckets = buckets;
|
| ︙ | | | ︙ | |