Overview
Comment: | A few renames in OFObject.
getMemWithSize: -> allocWithSize: |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e959fed01027d7f414f50f01866a0460 |
User & Date: | js on 2009-04-26 12:44:20 |
Other Links: | manifest | tags |
Context
2009-04-28
| ||
20:31 | Fix two missing spaces. check-in: 14f74f3c2f user: js tags: trunk | |
2009-04-26
| ||
12:44 | A few renames in OFObject. check-in: e959fed010 user: js tags: trunk | |
12:31 | Rename getIterator -> iterator. check-in: 8d10e738d1 user: js tags: trunk | |
Changes
Modified src/OFArray.m from [a4f78a390c] to [91667fe0ee].
︙ | |||
84 85 86 87 88 89 90 | 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 122 123 124 125 126 127 128 | - + - + - + | - add: (void*)item { if (SIZE_MAX - items < 1 || items + 1 > SIZE_MAX / itemsize) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMem: data toNItems: items + 1 |
︙ |
Modified src/OFDictionary.m from [a124a729d9] to [a34c760d2b].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - - + + | - init { self = [super init]; size = 4096; @try { |
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - - + + | newWithClass: c andSelector: _cmd]; } size = (size_t)1 << hashsize; @try { |
︙ |
Modified src/OFList.m from [64103fca3f] to [fdd9a22612].
︙ | |||
59 60 61 62 63 64 65 | 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 | - + - + | - (of_list_object_t*)last { return last; } - (of_list_object_t*)append: (id)obj { |
︙ | |||
102 103 104 105 106 107 108 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + | return o; } - (of_list_object_t*)insert: (id)obj before: (of_list_object_t*)listobj { |
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - + | return o; } - (of_list_object_t*)insert: (id)obj after: (of_list_object_t*)listobj { |
︙ |
Modified src/OFObject.h from [706bb1644c] to [8b1380da52].
︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | - + - - + + | /** * Allocate memory and store it in the objects memory pool so it can be free'd * automatically when the object is free'd. * * \param size The size of the memory to allocate * \return A pointer to the allocated memory */ |
︙ | |||
176 177 178 179 180 181 182 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | - + | * \param ptr A pointer to the already allocated memory * \param nitems The number of items to resize to * \param size The size of each item to resize to * \return A pointer to the resized memory chunk */ - (void*)resizeMem: (void*)ptr toNItems: (size_t)nitems |
︙ |
Modified src/OFObject.m from [352bb910bc] to [a774c5de86].
︙ | |||
210 211 212 213 214 215 216 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - + | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return self; } |
︙ | |||
242 243 244 245 246 247 248 | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - - + + - + - + | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return ptr; } |
︙ | |||
286 287 288 289 290 291 292 | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - + - - + + | @throw [OFMemNotPartOfObjException newWithClass: isa andPointer: ptr]; } - (void*)resizeMem: (void*)ptr toNItems: (size_t)nitems |
︙ |
Modified src/OFString.m from [881fc1c877] to [db633d72e6].
︙ | |||
162 163 164 165 166 167 168 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + | c = isa; [super free]; @throw [OFInvalidEncodingException newWithClass: c]; } @try { |
︙ | |||
265 266 267 268 269 270 271 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | - + | length = 0; is_utf8 = NO; @throw [OFInvalidEncodingException newWithClass: isa]; } length = len; |
︙ |
Modified src/OFTCPSocket.m from [a9b0b8f50a] to [59fbba1365].
︙ | |||
200 201 202 203 204 205 206 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + | socklen_t addrlen; int s; newsock = [OFTCPSocket new]; addrlen = sizeof(struct sockaddr); @try { |
︙ |
Modified tests/OFArray/OFArray.m from [c4671d9ef0] to [a61450d3be].
︙ | |||
38 39 40 41 42 43 44 | 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 | - + - + - + | puts("Trying to add too much to an array..."); \ a = [[type alloc] initWithItemSize: 4096]; \ CATCH_EXCEPTION([a addNItems: SIZE_MAX \ fromCArray: NULL], \ OFOutOfRangeException) \ \ puts("Trying to add something after that error..."); \ |
︙ |
Modified tests/OFObject/OFObject.m from [875bad3799] to [5969f41bb6].
︙ | |||
39 40 41 42 43 44 45 | 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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | - + - - - + + + - + - + | /* Test freeing memory not allocated by obj */ puts("Freeing memory not allocated by object (should throw an " "exception)..."); CATCH_EXCEPTION([obj freeMem: NULL], OFMemNotPartOfObjException) /* Test allocating memory */ puts("Allocating memory through object..."); |
︙ |