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 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


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