1 /* Public domain. */ 2 3 #include <stdbool.h> 4 #include <stdint.h> 5 #include <stdlib.h> 6 7 #pragma redefine_extname __atomic_is_lock_free_c __atomic_is_lock_free 8 9 bool 10 __atomic_is_lock_free_c(size_t size, void *ptr) 11 { 12 switch (size) { 13 case 1: 14 return true; 15 case 2: 16 return (((uintptr_t)ptr & 1) == 0); 17 case 4: 18 return (((uintptr_t)ptr & 3) == 0); 19 } 20 21 return false; 22 } 23