MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / atomic_incr32

Function atomic_incr32

vm/ByteCodeTranslator/src/rpmalloc.c:157–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155#endif
156
157static FORCEINLINE int32_t
158atomic_incr32(atomic32_t* val) {
159#ifdef _MSC_VER
160 int32_t old = (int32_t)_InterlockedExchangeAdd((volatile long*)&val->nonatomic, 1);
161 return (old + 1);
162#else
163 return __sync_add_and_fetch(&val->nonatomic, 1);
164#endif
165}
166
167static FORCEINLINE int32_t
168atomic_add32(atomic32_t* val, int32_t add) {

Callers 2

_memory_allocate_heapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected