This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GSoC] Patches for shared_ptr array and polymorphic_allocator


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]