Message ID | 20160330123453.GA17104@intel.com |
---|---|
State | New |
Headers | show |
diff --git a/libitm/beginend.cc b/libitm/beginend.cc index 20b5547..e2a8327 100644 --- a/libitm/beginend.cc +++ b/libitm/beginend.cc @@ -63,7 +63,14 @@ GTM::gtm_thread::operator new (size_t s) assert(s == sizeof(gtm_thread)); +#ifdef HAVE_POSIX_MEMALIGN + if (posix_memalign (&tx, __alignof__ (gtm_thread), sizeof (gtm_thread))) + GTM_fatal ("Out of memory allocating %lu bytes aligned at %lu bytes", + (unsigned long) sizeof (gtm_thread), + (unsigned long) __alignof__ (gtm_thread)); +#else tx = xmalloc (sizeof (gtm_thread), true); +#endif memset (tx, 0, sizeof (gtm_thread)); return tx;