Overview
Comment: | Check if 64 bit version of OSAtomic* functions is available. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
9626d917a6fb70287b182e6726205160 |
User & Date: | js on 2010-10-31 22:18:49 |
Other Links: | manifest | tags |
Context
2010-11-01
| ||
03:46 | Fix a bug with recent Clang revisions and Blocks. check-in: eb3e09c153 user: js tags: trunk | |
2010-10-31
| ||
22:18 | Check if 64 bit version of OSAtomic* functions is available. check-in: 9626d917a6 user: js tags: trunk | |
22:01 | Make reference counting of blocks atomic. check-in: 758559fd9f user: js tags: trunk | |
Changes
Modified configure.ac from [4739d63ce4] to [5a82833b3a].
︙ | |||
272 273 274 275 276 277 278 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | - - + + + + + | test x"$atomic_ops" = x"none" && atomic_ops="gcc builtins" AC_DEFINE(OF_HAVE_GCC_ATOMIC_OPS, 1, [Whether gcc atomic operations are available]) ], [AC_MSG_RESULT(no)]) AC_CHECK_HEADER(libkern/OSAtomic.h, [ test x"$atomic_ops" = x"none" && atomic_ops="libkern/OSAtomic.h" |
︙ |
Modified src/OFBlock.m from [239ba34c9f] to [d2c4fcd6af].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #import "OFBlock.h" #import "atomic.h" /// \cond internal @protocol RetainRelease - retain; - (void)release; @end /// \endcond |
︙ |
Modified src/atomic.h from [ccf7d7d55b] to [0a81676089].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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 | + + - + - + - + + + | /* * Copyright (c) 2008 - 2010 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include <stdlib.h> #import "macros.h" #if defined(OF_THREADS) && !defined(OF_X86_ASM) && !defined(OF_AMD64_ASM) && \ |
︙ | |||
60 61 62 63 64 65 66 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - + | : "+&r"(i) : "r"(i), "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, i); |
︙ | |||
82 83 84 85 86 87 88 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | - + - + + - + + | : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, i); |
︙ | |||
110 111 112 113 114 115 116 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - + + + | : "+&r"(i) : "r"(i), "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, i); |
︙ | |||
138 139 140 141 142 143 144 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | - + | : "+&r"(i) : "r"(i), "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, i); |
︙ | |||
161 162 163 164 165 166 167 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - + - + + - + + | : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, i); |
︙ | |||
192 193 194 195 196 197 198 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + + + | : "=&r"(i) : "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, 1); |
︙ | |||
222 223 224 225 226 227 228 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | - + | : "=&r"(i) : "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, 1); |
︙ | |||
248 249 250 251 252 253 254 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - + + + | : "=&r"(i) : "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, 1); |
︙ | |||
279 280 281 282 283 284 285 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - + | : "=&r"(i) : "m"(*p) ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, 1); |
︙ | |||
306 307 308 309 310 311 312 | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | - + + + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_or_and_fetch(p, i); |
︙ | |||
338 339 340 341 342 343 344 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_or_and_fetch(p, i); |
︙ | |||
365 366 367 368 369 370 371 | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | - + + + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_and_and_fetch(p, i); |
︙ | |||
397 398 399 400 401 402 403 | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | - + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_and_and_fetch(p, i); |
︙ | |||
424 425 426 427 428 429 430 | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - + + + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_xor_and_fetch(p, i); |
︙ | |||
456 457 458 459 460 461 462 | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - + | : "r"(i), "m"(*p) : "eax" ); return i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_xor_and_fetch(p, i); |
︙ | |||
488 489 490 491 492 493 494 | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | - + | : "=a"(r) : "a"(o), "r"(n), "m"(*p) ); return r; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_bool_compare_and_swap(p, o, n); |
︙ | |||
520 521 522 523 524 525 526 | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | - + | : "=a"(r) : "a"(o), "r"(n), "m"(*p) ); return r; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_bool_compare_and_swap(p, o, n); |
︙ | |||
552 553 554 555 556 557 558 | 572 573 574 575 576 577 578 579 580 581 582 | - + | : "=a"(r) : "a"(o), "q"(n), "m"(*p) ); return r; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_bool_compare_and_swap(p, o, n); |
Modified src/objfw-defs.h.in from [40a7e9074f] to [24da91ee6d].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + + | #undef OF_APPLE_RUNTIME #undef OF_HAVE_ASPRINTF #undef OF_ATOMIC_OPS #undef OF_BIG_ENDIAN #undef OF_GNU_RUNTIME #undef OF_HAVE_ASPRINTF #undef OF_HAVE_BLOCKS #undef OF_HAVE_FAST_ENUMERATION #undef OF_HAVE_GCC_ATOMIC_OPS |