ObjFW  Check-in [963db3089f]

Overview
Comment:objc_hashtable_alloc() -> objc_hashtable_new().

For consistency.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | runtime
Files: files | file ages | folders
SHA3-256: 963db3089f6d75de66a06b7e53562e1a7b05da7ce29852d2646f68cdc2c6deec
User & Date: js on 2012-05-10 18:21:18
Other Links: branch diff | manifest | tags
Context
2012-05-10
18:38
Return objects as void* instead of const void*. check-in: bc531024f5 user: js tags: runtime
18:21
objc_hashtable_alloc() -> objc_hashtable_new(). check-in: 963db3089f user: js tags: runtime
2012-05-09
13:55
Initialize classes on the first dispatch. check-in: dcf845546a user: js tags: runtime
Changes

Modified src/runtime/category.m from [e7600b0d22] to [c947f89bcc].

45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59







-
+







static void
register_category(struct objc_abi_category *cat)
{
	struct objc_abi_category **cats;
	Class cls = objc_classname_to_class(cat->class_name);

	if (categories == NULL)
		categories = objc_hashtable_alloc(2);
		categories = objc_hashtable_new(2);

	cats = (struct objc_abi_category**)objc_hashtable_get(categories,
	    cat->class_name);

	if (cats != NULL) {
		struct objc_abi_category **ncats;
		size_t i;

Modified src/runtime/class.m from [16b932ec92] to [db289f8cb1].

30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44







-
+







static size_t load_queue_cnt = 0;
static struct objc_sparsearray *empty_dtable = NULL;

static void
register_class(struct objc_abi_class *cls)
{
	if (classes == NULL)
		classes = objc_hashtable_alloc(2);
		classes = objc_hashtable_new(2);

	objc_hashtable_set(classes, cls->name, cls);

	if (empty_dtable == NULL)
		empty_dtable = objc_sparsearray_new();

	cls->dtable = empty_dtable;

Modified src/runtime/hashtable.m from [f05f1f70fa] to [2108c2f8fb].

42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56







-
+







	hash ^= (hash >> 11);
	hash += (hash << 15);

	return hash;
}

struct objc_hashtable*
objc_hashtable_alloc(uint32_t size)
objc_hashtable_new(uint32_t size)
{
	struct objc_hashtable *h;
	uint32_t i;

	if ((h = malloc(sizeof(struct objc_hashtable))) == NULL)
		ERROR("Not enough memory to allocate hash table!");

Modified src/runtime/runtime-private.h from [0a8ea1ad61] to [cfeaa72523].

143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
143
144
145
146
147
148
149

150
151
152
153
154
155
156
157







-
+







extern void objc_free_all_categories(void);
extern void objc_initialize_class(Class);
extern void objc_update_dtable(Class);
extern void objc_register_all_classes(struct objc_abi_symtab*);
extern Class objc_classname_to_class(const char*);
extern void objc_free_all_classes(void);
extern uint32_t objc_hash_string(const char*);
extern struct objc_hashtable* objc_hashtable_alloc(uint32_t);
extern struct objc_hashtable* objc_hashtable_new(uint32_t);
extern void objc_hashtable_set(struct objc_hashtable*, const char*,
    const void*);
extern const void* objc_hashtable_get(struct objc_hashtable*, const char*);
extern void objc_hashtable_free(struct objc_hashtable *h);
extern BOOL objc_hashtable_warn_on_collision;
extern void objc_register_selector(struct objc_abi_selector*);
extern void objc_register_all_selectors(struct objc_abi_symtab*);