I am using atomic_inc_64_nv
on 64bit Solaris, returned value is casted to unsigned long.
But when I run my app, it crashed and core is claming that the cause of the crash is SIGBUS. I Suspect there are could be alignment issues. How can I fix this problem?
Here is my function which uses increment
inline unsigned long long Increment64(volatile unsigned long long * pullTarget)
{
#if defined(LINUX)
return Add64(pullTarget, 1ULL);
#elif defined(SOLARIS)
return atomic_inc_64_nv((volatile unsigned long *)pullTarget) - 1ULL;
#elif defined(WIN32)
return (unsigned long long)InterlockedIncrement64((LONGLONG volatile*)(pullTarget)) - 1ULL;
#endif // defined(LINUX)
}
Thank you on advance.