Differences From Artifact [f9877d131a]:
- File src/runtime/hashtable.m — part of check-in [bc531024f5] at 2012-05-10 18:38:16 on branch runtime — Return objects as void* instead of const void*. (user: js, size: 3941) [annotate] [blame] [check-ins using] [more...]
To Artifact [3bc4ddb944]:
- File
src/runtime/hashtable.m
— part of check-in
[345eb93240]
at
2012-07-17 01:09:50
on branch trunk
— Rename ERROR() to OBJC_ERROR().
ERROR seems to be defined on MinGW32 and it's likely that it's also used
on other systems, thus it's better to prefix it with OBJC_. (user: js, size: 3981) [annotate] [blame] [check-ins using]
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + - + | struct objc_hashtable* objc_hashtable_new(uint32_t size) { struct objc_hashtable *h; uint32_t i; if ((h = malloc(sizeof(struct objc_hashtable))) == NULL) |
︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - + + | struct objc_hashtable_bucket **ndata; uint32_t nsize = (h->last_idx + 1) << 1; assert(nsize > 0); ndata = malloc(nsize * sizeof(struct objc_hashtable_bucket*)); if (ndata == NULL) |
︙ | |||
102 103 104 105 106 107 108 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + | last = h->data[i]->hash & (nsize - 1); for (j = 0; j < last && ndata[j] != NULL; j++); } if (j >= last) |
︙ | |||
124 125 126 127 128 129 130 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - + - + | if (i >= last) { last = hash & h->last_idx; for (i = 0; i < last && h->data[i] != NULL; i++); } if (i >= last) |
︙ |