ObjFW  History of src/atomic.h of d526d938d7860cbd

History of file src/atomic.h at check-in d526d938d7860cbd

2024-04-03
02:16
Change license to LGPLv3 only file: [98096c2476] check-in: [7413a728a7] user: js, branch: trunk, size: 3854 [annotate] [blame] [check-ins using] [diff]
2024-01-02
17:17
Update copyright file: [44218ac496] check-in: [26ddd2e4e4] user: js, branch: trunk, size: 3646 [annotate] [blame] [check-ins using] [diff]
2023-04-22
20:22
Rename x86_64 to AMD64

It's just a less awkward name and also what the BSDs use. file: [7b3ed1a98e] check-in: [b7a4e61b88] user: js, branch: trunk, size: 3646 [annotate] [blame] [check-ins using] [diff]

2023-01-06
09:04
Update copyright file: [bcb517e893] check-in: [8939cbdb52] user: js, branch: trunk, size: 3647 [annotate] [blame] [check-ins using] [diff]
2022-02-12
07:46
Update copyright file: [25c89d25b5] check-in: [1a86b8175b] user: js, branch: trunk, size: 3647 [annotate] [blame] [check-ins using] [diff]
2021-05-01
03:21
Move OFAtomic.h variants to src/platform file: [cd35260cdb] check-in: [1aedad1588] user: js, branch: trunk, size: 3647 [annotate] [blame] [check-ins using] [diff]
2021-04-18
20:51
Renamed src/atomic.h → src/OFAtomic.h. Rename everything in several smaller files file: [113d14691a] check-in: [35de667566] user: js, branch: new-naming-convention, size: 1184 [annotate] [blame] [check-ins using] [diff]
2021-01-02
22:04
Update copyright file: [7f44045855] check-in: [374e1a1bfa] user: js, branch: trunk, size: 1172 [annotate] [blame] [check-ins using] [diff]
2020-12-12
22:31
Remove OF_*_ASM defines

Duplicating defines for every CPU architecture is not very useful. file: [6778d083ff] check-in: [c859e2230c] user: js, branch: trunk, size: 1261 [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
Update copyright file: [7db74776cf] check-in: [c7f0229795] user: js, branch: trunk, size: 1223 [annotate] [blame] [check-ins using] [diff]
2019-01-27
16:13
atomic.h: Don't use assembly implementation on AIX

The assembler on AIX is too limited. file: [e53591a99c] check-in: [4a6d9cd210] user: js, branch: trunk, size: 1220 [annotate] [blame] [check-ins using] [diff]

2019-01-03
19:13
Update copyright file: [eb0ca3c5ef] check-in: [0509d7a844] user: js, branch: trunk, size: 1200 [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
Update copyright notice file: [40e749ef18] check-in: [7e5c81e186] user: js, branch: trunk, size: 1194 [annotate] [blame] [check-ins using] [diff]
2017-05-13
19:38
Do not use atomic_powerpc.h with Apple GCC

Apple GCC uses register 0 for "r" and there seems to be no way to avoid
this, while modern GCC does not seem to consider register 0 to be a GPR. file: [72942f053d] check-in: [636533772e] user: js, branch: trunk, size: 1171 [annotate] [blame] [check-ins using] [diff]

2017-01-09
17:36
Update copyright

Forgot to add 2017, even though I already did quite some changes in
2017. file: [c91cb23822] check-in: [44f45c2e35] user: js, branch: trunk, size: 1145 [annotate] [blame] [check-ins using] [diff]

2016-07-31
23:41
atomic.h: Add support for __atomic_* builtins file: [f4bb0c606a] check-in: [64edae4128] user: js, branch: trunk, size: 1139 [annotate] [blame] [check-ins using] [diff]
23:04
Split atomic.h into multiple files

Having one file per implementation reduces the #ifdef hell and makes it
much more readable. file: [f5eb774718] check-in: [7115c55ef0] user: js, branch: trunk, size: 1071 [annotate] [blame] [check-ins using] [diff]

21:54
Add of_memory_barrier_{producer,consumer}()

Also changes the naming slightly (leave -> exit). This is more similar
to the membar_*() API NetBSD and OpenBSD provides. file: [0145f59683] check-in: [24796a2dc1] user: js, branch: trunk, size: 20414 [annotate] [blame] [check-ins using] [diff]

2016-07-30
23:29
atomic.h: Use the OSAtomic variant without barrier

This matches what the assembly versions does. However, the __sync_*
versions still use the barrier, but unfortunately, no version without it
is provided. The only way around this would be to use the new __atomic_*
that has been added in GCC 4.7. file: [50acc02363] check-in: [0c3e3da576] user: js, branch: trunk, size: 20052 [annotate] [blame] [check-ins using] [diff]

21:46
of_memory_barrier(): Only use mfence on x86_64

This is only available on x86 with SSE2, while it's always available on
x86_64. However, checking if SSE2 is available here would be too slow,
therefore let the compiler decide what do do instead (which will depend
on the selected target CPU). file: [23c4a049f4] check-in: [9feaa90358] user: js, branch: trunk, size: 20199 [annotate] [blame] [check-ins using] [diff]

21:18
atomic.h: Improve memory barrier

Replace of_memory_read_barrier() and of_memory_write_barrier() - which
are quite unspecific - with of_memory_enter_barrier() and
of_memory_leave_barrier().

Also add an assembly implementation for ARM and ARM64. file: [c6a5af4a20] check-in: [96a128f954] user: js, branch: trunk, size: 20222 [annotate] [blame] [check-ins using] [diff]

2016-01-03
00:43
Update copyright

While at it, also update the mail address. file: [4b9a633048] check-in: [cec0f072f8] user: js, branch: 0.8, size: 20345 [annotate] [blame] [check-ins using] [diff]

00:41
Update copyright

While at it, also update the mail address. file: [17afd94567] check-in: [2a27cf3000] user: js, branch: trunk, size: 20353 [annotate] [blame] [check-ins using] [diff]

2015-11-21
18:35
Remove OF_NULLABLE / OF_NONNULL

Now that Clang switched to use _Nullable and _Nonnull instead of
__nullable / __nonnull, there is no longer a conflict with glibc, which
means we can just define _Nullable / _Nonnull to nothing if they are not
understood by the compiler (which did not work with __nullable /
__nonnull due to this conflict).

This also defines _Null_unspecified to nothing if unavailable. file: [5acf14775c] check-in: [d526d938d7] user: js, branch: trunk, size: 20349 [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
Add platform.h & make platform defines consistent file: [6e95bb1842] check-in: [1ba08eebc5] user: js, branch: trunk, size: 20397 [annotate] [blame] [check-ins using] [diff]
2015-06-14
10:45
Add OF_NONNULL / OF_NULLABLE and use that instead

Using __nonnull directly doesn't work on systems using glibc, as glibc
defines __nonnull as a parameterized define. While this does not fix the
problem of Clang introducing __nonnull even though it conflicts with
glibc, this at least means it's possible again to compile things with
versions of Clang that don't support __nonnull on systems with glibc. file: [cc8d24b757] check-in: [b7097a67b6] user: js, branch: trunk, size: 20341 [annotate] [blame] [check-ins using] [diff]

2015-06-13
22:26
Add support for and use the new nullability file: [907e2f3914] check-in: [9e76144ef8] user: js, branch: trunk, size: 20317 [annotate] [blame] [check-ins using] [diff]
2015-01-03
20:57
Update copyright file: [4c89aaf0ff] check-in: [cfd374b906] user: js, branch: trunk, size: 20020 [annotate] [blame] [check-ins using] [diff]
2014-05-07
03:19
Add atomic ops assembly implementation for PowerPC file: [e98a87dd4f] check-in: [93e23b476c] user: js, branch: trunk, size: 20014 [annotate] [blame] [check-ins using] [diff]
02:46
atomic.h: Minor style improvements file: [1f71674619] check-in: [461e70403e] user: js, branch: trunk, size: 15379 [annotate] [blame] [check-ins using] [diff]
2014-05-05
01:42
atomic.h: Prefer GCC builtins over ASM

The compiler can optimize the builtins better. For example, if the
result is not used, the compiler can use an instruction that does not
fetch the result and thus might generate more efficient code. file: [53694a578a] check-in: [a199313c53] user: js, branch: trunk, size: 15396 [annotate] [blame] [check-ins using] [diff]

01:08
Improve atomics API file: [838c97203e] check-in: [a92844520a] user: js, branch: trunk, size: 15396 [annotate] [blame] [check-ins using] [diff]
2014-02-22
01:14
Rename AMD64 to x86_64 file: [9f476a30f6] check-in: [05f4b0a4f0] user: js, branch: trunk, size: 15348 [annotate] [blame] [check-ins using] [diff]
2014-02-21
17:16
atomic.h: Fix OSAtomic on PPC64 file: [a649199f5c] check-in: [2b00b3cec8] user: js, branch: trunk, size: 15319 [annotate] [blame] [check-ins using] [diff]
2014-01-31
13:33
Make sure there's always an #else in abstractions file: [5741f77007] check-in: [0a8dca300b] user: js, branch: trunk, size: 16475 [annotate] [blame] [check-ins using] [diff]
2014-01-04
00:24
Update copyright. file: [b04aa21809] check-in: [3b97fc3cd9] user: js, branch: trunk, size: 16413 [annotate] [blame] [check-ins using] [diff]
2013-06-03
15:20
atomic.h: Fix several issues.

* of_atomic_cmpswap_*: Clobber eax by adding it as an (unused) output,
so the compiler resets eax (e.g. when used in a loop). (Adding it
to the input and clobber list is lot legal!)
* Don't dereference the pointer passed using "m"(*p) twice.
* Fix some code for ILP64 systems (it seems there is no architecture
using it, though, as it even contained syntax errors).
* Use __asm__ __volatile__ just to be sure.

Thanks to Florian Zeitz for pointing out most of these issues! file: [309e66c1ae] check-in: [6b15bb229e] user: js, branch: trunk, size: 16407 [annotate] [blame] [check-ins using] [diff]

2013-06-02
21:18
atomic.h: Remove a useless xor. file: [a51ca829b8] check-in: [1c7175697e] user: js, branch: trunk, size: 16022 [annotate] [blame] [check-ins using] [diff]
2013-03-14
19:25
Add a few memory barriers. file: [d4ea46f231] check-in: [27138ee85b] user: js, branch: trunk, size: 16091 [annotate] [blame] [check-ins using] [diff]
2013-03-04
17:20
Replace BOOL with bool.

The only places where BOOL is left are those where they are required by
the ABI. file: [a4f95ba0da] check-in: [c5ef582958] user: js, branch: trunk, size: 15322 [annotate] [blame] [check-ins using] [diff]

2013-01-15
02:06
Prevent importing atomic.h without atomic ops. file: [e354f89407] check-in: [a7c16ea8b3] user: js, branch: trunk, size: 15310 [annotate] [blame] [check-ins using] [diff]
2013-01-12
20:53
Clean up the feature #ifdef mess. file: [368de22827] check-in: [b8ce2359f3] user: js, branch: trunk, size: 15211 [annotate] [blame] [check-ins using] [diff]
2013-01-09
22:24
Update copyright. file: [7c0142eaf1] check-in: [813c00ccf0] user: js, branch: trunk, size: 15116 [annotate] [blame] [check-ins using] [diff]
2012-08-11
13:37
atomic.h: Add cc to clobber list where necessary. file: [ca437e8011] check-in: [abd6fadbdb] user: js, branch: trunk, size: 15110 [annotate] [blame] [check-ins using] [diff]
2012-07-21
11:42
Error out if an atomic operation is missing. file: [fe64838cdd] check-in: [196aa3f6fe] user: js, branch: trunk, size: 15024 [annotate] [blame] [check-ins using] [diff]
2012-07-10
22:39
atomic.h: Work around a bug in GCC's inline asm. file: [cfff404a91] check-in: [932bc09a31] user: js, branch: trunk, size: 14353 [annotate] [blame] [check-ins using] [diff]
2012-07-07
11:12
atomic.h: Add missing cast. file: [fe9035342d] check-in: [61d0a2e987] user: js, branch: trunk, size: 14233 [annotate] [blame] [check-ins using] [diff]
2012-05-30
22:03
atomic.h: Use sete instead of the ugly jne. file: [874337cdfb] check-in: [22aea96b79] user: js, branch: trunk, size: 14219 [annotate] [blame] [check-ins using] [diff]
2012-03-21
09:46
Make atomic ops work on an ILP64 AMD64 system. file: [0e0a7c1a99] check-in: [448d8b46f9] user: js, branch: trunk, size: 14225 [annotate] [blame] [check-ins using] [diff]
09:22
Fix of_atomic_{add,sub}_ptr on AMD64. file: [6e23ade0bb] check-in: [19421c0b6b] user: js, branch: trunk, size: 12254 [annotate] [blame] [check-ins using] [diff]
2012-01-05
00:56
Update copyright. file: [1848f8ec6b] check-in: [ce70e17b38] user: js, branch: trunk, size: 11965 [annotate] [blame] [check-ins using] [diff]
2011-03-11
13:16
Don't test OFHTTPRequest if we have no threads. file: [2048e9e8f7] check-in: [80b8456b4b] user: js, branch: trunk, size: 11959 [annotate] [blame] [check-ins using] [diff]
2011-01-01
20:19
Change license. file: [672922eb8c] check-in: [da6b3d26cb] user: js, branch: trunk, size: 11925 [annotate] [blame] [check-ins using] [diff]
2010-12-08
23:18
Fix local labels in inline assembly. file: [d7c1fc83e5] check-in: [c10cc0f9e2] user: js, branch: trunk, size: 11669 [annotate] [blame] [check-ins using] [diff]
2010-12-05
21:32
Don't use the lahf instruction.
Some early AMD64 CPUs don't support it.
file: [c57a56dcf7] check-in: [0272a8686f] user: js, branch: trunk, size: 11675 [annotate] [blame] [check-ins using] [diff]
2010-11-08
19:24
Fix type of the new *_ptr atomic ops. file: [9f0732f9a3] check-in: [8ae37b5b5f] user: js, branch: trunk, size: 11754 [annotate] [blame] [check-ins using] [diff]
2010-10-31
22:18
Check if 64 bit version of OSAtomic* functions is available. file: [0a81676089] check-in: [9626d917a6] user: js, branch: trunk, size: 11754 [annotate] [blame] [check-ins using] [diff]
21:59
More atomic operations. file: [ccf7d7d55b] check-in: [dd061ee65e] user: js, branch: trunk, size: 11551 [annotate] [blame] [check-ins using] [diff]
2010-10-06
09:21
Fix x86(_64) asm for of_atomic_{or,and,xor}_32.
Improve x86(_64) asm for of_atomic_cmpswap_{32,ptr}.
file: [4d9142af8f] check-in: [7334aa1c81] user: js, branch: trunk, size: 5432 [annotate] [blame] [check-ins using] [diff]
2010-10-05
19:31
Fix x86(_64) asm for of_atomic_{add,sub,inc,dec}_32.
of_atomic_{or,and,xor}_32 to follow.
file: [842f2e4fa9] check-in: [6ea2424dad] user: js, branch: trunk, size: 5151 [annotate] [blame] [check-ins using] [diff]
2010-08-25
21:35
Assembly implementation for atomic operations (x86 and AMD64). file: [527e2eb067] check-in: [bd2eef5fe1] user: js, branch: trunk, size: 5062 [annotate] [blame] [check-ins using] [diff]
2010-03-05
11:52
Merge a few changesets from the default branch into the 0.2 branch.

Changesets:
* b95fcaa6d694
* 804c68d222b4
* da8cd738da3d
* 1109d5ce3419
* d03f5c1ca95d
* 2a7017722165
* 4fccdc79eeb7
* d228149fbc04
* 8782d412a4a6 file: [3969906906] check-in: [b91a8283fe] user: js, branch: 0.2, size: 2842 [annotate] [blame] [check-ins using] [diff]

2010-02-19
16:36
Update copyright. file: [dece28bae9] check-in: [42886185fd] user: js, branch: trunk, size: 3200 [annotate] [blame] [check-ins using] [diff]
2010-02-05
14:03
Rename of_atomic_*32 to of_atomic_*_32 and add of_atomic_cmpswap_ptr. file: [9d7b0c4eb9] check-in: [4e1ab53403] user: js, branch: trunk, size: 3200 [annotate] [blame] [check-ins using] [diff]
2010-02-02
18:58
Rename OFMacros.h to macros.h, as it's not a class. file: [9244f42746] check-in: [832188d759] user: js, branch: trunk, size: 2840 [annotate] [blame] [check-ins using] [diff]
2010-01-30
12:33
Convert more macros to OF_INLINE functions. file: [465cd0b0aa] check-in: [8acda3b3fd] user: js, branch: trunk, size: 2842 [annotate] [blame] [check-ins using] [diff]
02:09
Replace some macros with OF_INLINE functions.
This way, there won't be a warning about unused results.
file: [243643e5ed] check-in: [839f45a293] user: js, branch: trunk, size: 1861 [annotate] [blame] [check-ins using] [diff]
01:17
Change spinlock implementation, add fallbacks and move to threading.h. file: [a1c4c931ea] check-in: [921b158d17] user: js, branch: trunk, size: 1799 [annotate] [blame] [check-ins using] [diff]
2010-01-29
15:22
Add more atomic ops. file: [a774b233fa] check-in: [78537d6ff3] user: js, branch: trunk, size: 2028 [annotate] [blame] [check-ins using] [diff]
2010-01-25
22:39
Add of_atomic_cmpswap32 and spinlocks to atomic.h. file: [ac71df6e7f] check-in: [212482d8c6] user: js, branch: trunk, size: 1294 [annotate] [blame] [check-ins using] [diff]
22:14
Check for atomic ops in configure.ac. file: [10a1c95236] check-in: [c2af363418] user: js, branch: trunk, size: 824 [annotate] [blame] [check-ins using] [diff]
2010-01-24
18:54
Added: Make retain/release atomic. file: [34bfd081ab] check-in: [b4a9924066] user: js, branch: trunk, size: 803 [annotate] [blame] [check-ins using]