[GSoC] Patches for shared_ptr array and polymorphic_allocator
Tim Shen
timshen@google.com
Sat Aug 1 00:51:00 GMT 2015
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
More information about the Libstdc++
mailing list