This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [GSoC] Patches for shared_ptr array and polymorphic_allocator
- From: Tim Shen <timshen at google dot com>
- To: Fan You <youfan dot noey at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>
- Date: Sat, 18 Jul 2015 23:29:47 -0700
- Subject: Re: [GSoC] Patches for shared_ptr array and polymorphic_allocator
- Authentication-results: sourceware.org; auth=none
- References: <CALvpekFHJ1k2pcQdJxFCbppPf3N6HTGjR-JQyNZi0_oLZJEC5Q at mail dot gmail dot com> <CAG4ZjNmWxZSdoWpk2RtOJpPy1XpUtFbJuny1YxG065SnraKvWQ at mail dot gmail dot com> <CALvpekG=Muiw8a9h1OzHGD7Yn6iytmMyTwYPQs1mX_ZYTjkgTQ at mail dot gmail dot com>
On Sat, Jul 18, 2015 at 3:01 PM, Fan You <youfan.noey@gmail.com> wrote:
> However [8.8.6] said, If r is non-null, sets the value of the default memory
> resource pointer to r, otherwise sets the default memory resource pointer to
> new_delete_resource().
Ah right, so the only place we should care about is set_default_resource:
void
set_default_resource(memory_resource __r)
{
std::atomic<memory_resource> __new_ptr = __r ? __r : new_delete_resource();
return __new_ptr.exchange(memory_resource::_S_default_resource);
}
--
Regards,
Tim Shen