ObjFW  Diff

Differences From Artifact [ae861b76c6]:

To Artifact [570b1e1aa5]:


25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
+ dictionaryWithHashSize: (int)hashsize
{
	return [[[OFDictionary alloc] initWithHashSize: hashsize] autorelease];
}

- init
{
	if ((self = [super init])) {

		size = 4096;

		@try {
			data = [self getMemForNItems: size
					      ofSize: sizeof(OFList*)];
		} @catch (OFException *e) {
			[self free];
			@throw e;
		}
		memset(data, 0, size);
	}

	return self;
}

- initWithHashSize: (int)hashsize
{
	if ((self = [super init])) {

		if (hashsize < 8 || hashsize > 31) {
			Class c = isa;
			[self free];
			@throw [OFInvalidArgumentException
			    newWithClass: c
			     andSelector: _cmd];
		}

		size = (size_t)1 << hashsize;

		@try {
			data = [self getMemForNItems: size
					      ofSize: sizeof(OFList*)];
		} @catch (OFException *e) {
			[self free];
			@throw e;
		}
		memset(data, 0, size);
	}

	return self;
}

- free
{
	size_t i;







|
>
|

|
|
|
|
|
|
|
|
<






|
>
|
|
|
|
|
|
|

|

|
|
|
|
|
|
|
|
<







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

70
71
72
73
74
75
76
+ dictionaryWithHashSize: (int)hashsize
{
	return [[[OFDictionary alloc] initWithHashSize: hashsize] autorelease];
}

- init
{
	self = [super init];

	size = 4096;

	@try {
		data = [self getMemForNItems: size
				      ofSize: sizeof(OFList*)];
	} @catch (OFException *e) {
		[self free];
		@throw e;
	}
	memset(data, 0, size);


	return self;
}

- initWithHashSize: (int)hashsize
{
	self = [super init];

	if (hashsize < 8 || hashsize > 31) {
		Class c = isa;
		[self free];
		@throw [OFInvalidArgumentException
			newWithClass: c
			 andSelector: _cmd];
	}

	size = (size_t)1 << hashsize;

	@try {
		data = [self getMemForNItems: size
				      ofSize: sizeof(OFList*)];
	} @catch (OFException *e) {
		[self free];
		@throw e;
	}
	memset(data, 0, size);


	return self;
}

- free
{
	size_t i;