Comment: | Revert several OFHashMap related commits.
This reverts: It turned out that these were slowing down all classes based on |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6712442fad3b6214a6292b266b0318db |
User & Date: | js on 2012-12-07 13:57:13 |
Other Links: | manifest | tags |
2012-12-07
| ||
14:50 | quicksort: Reduce used space. check-in: a747ad5478 user: js tags: trunk | |
13:57 | Revert several OFHashMap related commits. check-in: 6712442fad user: js tags: trunk | |
02:11 | Make GCC happy by declaring private methods. check-in: bff1f8e5a7 user: js tags: trunk | |
Modified src/OFMapTable.h from [91b9317d21] to [dcccbffbc5].
︙ | |||
46 47 48 49 50 51 52 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - - | */ @interface OFMapTable: OFObject <OFCopying, OFFastEnumeration> { of_map_table_functions_t keyFunctions, valueFunctions; struct of_map_table_bucket **buckets; uint32_t minCapacity, capacity, count; unsigned long mutations; |
︙ |
Modified src/OFMapTable.m from [fda4d04529] to [458807374d].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - - - | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" |
︙ | |||
148 149 150 151 152 153 154 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | - - - - - | minCapacity = capacity; buckets = [self allocMemoryWithSize: sizeof(*buckets) count: capacity]; memset(buckets, 0, capacity * sizeof(*buckets)); |
︙ | |||
230 231 232 233 234 235 236 | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | - - + - | @try { uint32_t i; for (i = 0; i < capacity; i++) if (buckets[i] != NULL && buckets[i] != &deleted) [copy OF_setValue: buckets[i]->value forKey: buckets[i]->key |
︙ | |||
257 258 259 260 261 262 263 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - + | uint32_t i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; |
︙ | |||
287 288 289 290 291 292 293 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | - + - | } return NULL; } - (void)OF_resizeForCount: (uint32_t)newCount { |
︙ | |||
313 314 315 316 317 318 319 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - - - - - - - - - - - | newBuckets = [self allocMemoryWithSize: sizeof(*newBuckets) count: newCapacity]; for (i = 0; i < newCapacity; i++) newBuckets[i] = NULL; |
︙ | |||
350 351 352 353 354 355 356 | 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 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 | - - - + - - + - - + - - + - + | newBuckets[j] = buckets[i]; } } [self freeMemory: buckets]; buckets = newBuckets; capacity = newCapacity; |
︙ | |||
434 435 436 437 438 439 440 | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | - + | bucket->value = valueFunctions.retain(value); } @catch (id e) { keyFunctions.release(key); [self freeMemory: bucket]; @throw e; } |
︙ | |||
464 465 466 467 468 469 470 | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | - + | uint32_t i, hash, last; if (key == NULL) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; |
︙ |
Modified src/OFObject.h from [b44a7c59ae] to [c663f1ca8f].
︙ | |||
873 874 875 876 877 878 879 | 873 874 875 876 877 878 879 880 881 882 883 884 885 | - | #import "OFObject+Serialization.h" #ifdef __cplusplus extern "C" { #endif extern id of_alloc_object(Class class_, size_t extraSize, size_t extraAlignment, void **extra); |
Modified src/OFObject.m from [0307a15aa9] to [ce3e8ba58d].
︙ | |||
225 226 227 228 229 230 231 | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | if OF_UNLIKELY (extra != NULL) *extra = (char*)instance + instanceSize + extraAlignment; return instance; } |
︙ | |||
307 308 309 310 311 312 313 | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | + - + + + + + + + + + + + + | of_pagesize = 4096; # ifdef _SC_NPROCESSORS_CONF if ((of_num_cpus = sysconf(_SC_NPROCESSORS_CONF)) < 1) # endif of_num_cpus = 1; #endif #if defined(OF_HAVE_ARC4RANDOM) |
︙ |
Modified src/macros.h from [6b2bc955be] to [ba733f14be].
︙ | |||
321 322 323 324 325 326 327 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | - - - | #if defined(__MACH__) && defined(__arm__) # define OF_IOS #endif #define OF_ROL(value, bits) \ (((value) << ((bits) % (sizeof(value) * 8))) | \ (value) >> (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8)))) |
︙ |