This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libitm: Support sized delete.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 03 Nov 2015 11:46:41 +0100
- Subject: Re: [PATCH] libitm: Support sized delete.
- Authentication-results: sourceware.org; auth=none
- References: <1446142772 dot 7192 dot 12 dot camel at localhost dot localdomain> <563275CB dot 6080307 at redhat dot com> <1446199141 dot 7192 dot 17 dot camel at localhost dot localdomain> <5633A6B9 dot 5060704 at redhat dot com>
On Fri, 2015-10-30 at 10:19 -0700, Richard Henderson wrote:
> > #define _ZnwX S(_Znw,MANGLE_SIZE_T)
> > #define _ZnaX S(_Zna,MANGLE_SIZE_T)
> > +#define _ZdlPvX S(_ZdlPv,MANGLE_SIZE_T)
> > #define _ZnwXRKSt9nothrow_t S(S(_Znw,MANGLE_SIZE_T),RKSt9nothrow_t)
> > #define _ZnaXRKSt9nothrow_t S(S(_Zna,MANGLE_SIZE_T),RKSt9nothrow_t)
> > +#define _ZdlPvXRKSt9nothrow_t S(S(_ZdlPv,MANGLE_SIZE_T),RKSt9nothrow_t)
These are symbols that are provided by libstdc++ if it is available
(otherwise, we use dummy implementations, see the other parts of the
patch)...
> > #define _ZGTtnwX S(_ZGTtnw,MANGLE_SIZE_T)
> > #define _ZGTtnaX S(_ZGTtna,MANGLE_SIZE_T)
> > +#define _ZGTtdlPvX S(_ZGTtdlPv,MANGLE_SIZE_T)
> > #define _ZGTtnwXRKSt9nothrow_t S(S(_ZGTtnw,MANGLE_SIZE_T),RKSt9nothrow_t)
> > #define _ZGTtnaXRKSt9nothrow_t S(S(_ZGTtna,MANGLE_SIZE_T),RKSt9nothrow_t)
> > +#define _ZGTtdlPvXRKSt9nothrow_t S(S(_ZGTtdlPv,MANGLE_SIZE_T),RKSt9nothrow_t)
>
> One more thing... Why are there 4 new symbols here...
>
> > +/* Wrap: operator delete(void* ptr, std::size_t sz) */
> > +void
> > +_ZGTtdlPvX (void *ptr, size_t sz)
> > +{
> > + if (ptr)
> > + gtm_thr()->forget_allocation (ptr, sz, _ZdlPvX);
> > +}
> > +
> > +/* Wrap: operator delete (void *ptr, std::size_t sz, const std::nothrow_t&) */
> > +void
> > +_ZGTtdlPvXRKSt9nothrow_t (void *ptr, size_t sz, c_nothrow_p nt UNUSED)
> > +{
> > + if (ptr)
> > + gtm_thr()->forget_allocation (ptr, sz, delsz_opnt);
> > +}
> > +
... while those are the transactional wrappers that we actually want to
provide and export from libitm.
I'll probably revise the patch in a v2 though depending on how we decide
to handle allocations of exception objects.