Why can't I see a transactional malloc()/free()?

Why can't I see a transactional malloc()/free()?

The release notes for the Intel STM Prototype v2.0 promise a transactional malloc() and free(). Version 3.0 promises new and delete operators, in addition. I am using v3.0 now, and my tm_safe functions do not compile because these two functions are not recognized to be transaction-safe. I'm confused.

Does the compiler include a transactional malloc/free? If so, can you provide me with a simple example which compiles tm_safe functions that perform memory management?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - andresjaantack
The release notes for the Intel STM Prototype v2.0 promise a transactional malloc() and free(). Version 3.0 promises new and delete operators, in addition. I am using v3.0 now, and my tm_safe functions do not compile because these two functions are not recognized to be transaction-safe. I'm confused.

Does the compiler include a transactional malloc/free? If so, can you provide me with a simple example which compiles tm_safe functions that perform memory management?

Intel STM Prototype v3.0 does provide transactional malloc() and free(). Any time malloc and free are used in __tm_atomic region or a function marked with tm_callable attribute they are replaced with a transactional safe malloc and free. For functions which are marked with tm_safe attribute, the compiler assumes user guarantees the safety of that function and does not replace the malloc and free. The user has to use his own transactional safe malloc and free in this case. Try your program by replacing tm_safe with tm_callable

Leave a Comment

Please sign in to add a comment. Not a member? Join today