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>
- Date: Fri, 31 Jul 2015 17:51:44 -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> <CAG4ZjNnVKpxWeV+JDoBtK7=fZ5duy04aKcSLrUQSTQF=87=4FQ at mail dot gmail dot com> <20150720095050 dot GM21787 at redhat dot com> <CALvpekG0XcKSzAvgv+ZW68W8+oTX3Va20UpuLRJnoF17_FQAwA at mail dot gmail dot com> <20150728115727 dot GK10878 at redhat dot com> <CALvpekEDQnkED5OaMm6Gd=1kgEuBMf+ZMvOep1tKsJXzr5t6pA at mail dot gmail dot com>
On Thu, Jul 30, 2015 at 8:40 PM, Fan You <youfan.noey@gmail.com> wrote:
> Patch updated with tests.
>
> Bootstrapped and tested on Darwin 10.10.4.
>
Looks good to me, only a few stylish comments:
+ // Calculate Aligned Size
+ // Returns a size that is larger than or equal to __size and divided by
+ // __alignment, where __alignment is required to be the power of 2.
+ size_t _Aligned_size(size_t __size, size_t __alignment)
+ { return ((__size - 1)|(__alignment - 1)) + 1; }
static size_t
_S_aligned_size...
+ bool _M_supported (size_t __x)
+ { return ((__x != 0) && (__x != 0) && !(__x & (__x - 1))); }
Documentation? Also make it static.
+ // Global memory resources
+ inline std::atomic<memory_resource*>&
+ _S_get_default_resource()
__get_default_resource.
--
Regards,
Tim Shen