Commit 4f8a3b87 by Torvald Riegel Committed by Torvald Riegel

libitm: Fix recent changes to allocations log.

	libitm/
	* libitm_i.h (gtm_alloc_action): Remove union.
	* testsuite/libitm.c/alloc-1.c: New.

From-SVN: r230727
parent 9b22c1b6
2015-11-22 Torvald Riegel <triegel@redhat.com>
* libitm_i.h (gtm_alloc_action): Remove union.
* testsuite/libitm.c/alloc-1.c: New.
2015-11-19 Torvald Riegel <triegel@redhat.com> 2015-11-19 Torvald Riegel <triegel@redhat.com>
* testsuite/libitm.c++/eh-5.C: New. * testsuite/libitm.c++/eh-5.C: New.
......
...@@ -106,12 +106,10 @@ namespace GTM HIDDEN { ...@@ -106,12 +106,10 @@ namespace GTM HIDDEN {
// the template used inside gtm_thread can instantiate. // the template used inside gtm_thread can instantiate.
struct gtm_alloc_action struct gtm_alloc_action
{ {
// Iff free_fn_sz is nonzero, it must be used instead of free_fn. // Iff free_fn_sz is nonzero, it must be used instead of free_fn, and vice
union // versa.
{ void (*free_fn)(void *);
void (*free_fn)(void *); void (*free_fn_sz)(void *, size_t);
void (*free_fn_sz)(void *, size_t);
};
size_t sz; size_t sz;
// If true, this is an allocation; we discard the log entry on outermost // If true, this is an allocation; we discard the log entry on outermost
// commit, and deallocate on abort. If false, this is a deallocation and // commit, and deallocate on abort. If false, this is a deallocation and
......
// Test that rolling back allocations works.
#include <stdlib.h>
void __attribute((transaction_pure,noinline)) dont_optimize(void* p)
{
*(volatile char *) p;
}
int main()
{
__transaction_atomic {
void *p = malloc (23);
dont_optimize (p);
__transaction_cancel;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment