Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AA7C6200C7E for ; Tue, 23 May 2017 23:25:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A8F28160BA4; Tue, 23 May 2017 21:25:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A47CD160BE8 for ; Tue, 23 May 2017 23:25:07 +0200 (CEST) Received: (qmail 59724 invoked by uid 500); 23 May 2017 21:25:06 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 59075 invoked by uid 99); 23 May 2017 21:25:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2017 21:25:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C9C46E0667; Tue, 23 May 2017 21:25:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Date: Tue, 23 May 2017 21:25:52 -0000 Message-Id: <9c47a0e2cc094470a906ef6837e937f9@git.apache.org> In-Reply-To: <989ea84a85c44534a0605f0217472594@git.apache.org> References: <989ea84a85c44534a0605f0217472594@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [50/51] [partial] arrow-site git commit: Update C++ docs archived-at: Tue, 23 May 2017 21:25:12 -0000 http://git-wip-us.apache.org/repos/asf/arrow-site/blob/5875f2bc/docs/cpp/allocator_8h_source.html ---------------------------------------------------------------------- diff --git a/docs/cpp/allocator_8h_source.html b/docs/cpp/allocator_8h_source.html index 687196a..77fc719 100644 --- a/docs/cpp/allocator_8h_source.html +++ b/docs/cpp/allocator_8h_source.html @@ -3,16 +3,15 @@ - + + Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/allocator.h Source File + - @@ -21,7 +20,7 @@ -
+
Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
@@ -31,47 +30,25 @@
- + - - + + + + +
@@ -90,107 +67,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
allocator.h
-Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
-
2 // or more contributor license agreements. See the NOTICE file
-
3 // distributed with this work for additional information
-
4 // regarding copyright ownership. The ASF licenses this file
-
5 // to you under the Apache License, Version 2.0 (the
-
6 // "License"); you may not use this file except in compliance
-
7 // with the License. You may obtain a copy of the License at
-
8 //
-
9 // http://www.apache.org/licenses/LICENSE-2.0
-
10 //
-
11 // Unless required by applicable law or agreed to in writing,
-
12 // software distributed under the License is distributed on an
-
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-
14 // KIND, either express or implied. See the License for the
-
15 // specific language governing permissions and limitations
-
16 // under the License.
-
17 
-
18 #ifndef ARROW_ALLOCATOR_H
-
19 #define ARROW_ALLOCATOR_H
-
20 
-
21 #include <cstddef>
-
22 #include <memory>
-
23 #include <utility>
-
24 
-
25 #include "arrow/memory_pool.h"
-
26 #include "arrow/status.h"
-
27 
-
28 namespace arrow {
-
29 
-
30 template <class T>
- -
32  public:
-
33  using value_type = T;
-
34  using pointer = T*;
-
35  using const_pointer = const T*;
-
36  using reference = T&;
-
37  using const_reference = const T&;
-
38  using size_type = std::size_t;
-
39  using difference_type = std::ptrdiff_t;
-
40 
-
41  template <class U>
-
42  struct rebind {
- -
44  };
-
45 
-
46  stl_allocator() noexcept : pool_(default_memory_pool()) {}
-
47  explicit stl_allocator(MemoryPool* pool) noexcept : pool_(pool) {}
-
48 
-
49  template <class U>
-
50  stl_allocator(const stl_allocator<U>& rhs) noexcept : pool_(rhs.pool_) {}
-
51 
-
52  ~stl_allocator() { pool_ = nullptr; }
-
53 
-
54  pointer address(reference r) const noexcept { return std::addressof(r); }
-
55 
-
56  const_pointer address(const_reference r) const noexcept { return std::addressof(r); }
-
57 
-
58  pointer allocate(size_type n, const void* /*hint*/ = nullptr) {
-
59  uint8_t* data;
-
60  Status s = pool_->Allocate(n * sizeof(T), &data);
-
61  if (!s.ok()) throw std::bad_alloc();
-
62  return reinterpret_cast<pointer>(data);
-
63  }
-
64 
- -
66  pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T));
-
67  }
-
68 
-
69  size_type size_max() const noexcept { return size_type(-1) / sizeof(T); }
-
70 
-
71  template <class U, class... Args>
-
72  void construct(U* p, Args&&... args) {
-
73  new (reinterpret_cast<void*>(p)) U(std::forward<Args>(args)...);
-
74  }
-
75 
-
76  template <class U>
-
77  void destroy(U* p) {
-
78  p->~U();
-
79  }
-
80 
-
81  MemoryPool* pool() const noexcept { return pool_; }
-
82 
-
83  private:
-
84  MemoryPool* pool_;
-
85 };
-
86 
-
87 template <class T1, class T2>
-
88 bool operator==(const stl_allocator<T1>& lhs, const stl_allocator<T2>& rhs) noexcept {
-
89  return lhs.pool() == rhs.pool();
-
90 }
-
91 
-
92 template <class T1, class T2>
-
93 bool operator!=(const stl_allocator<T1>& lhs, const stl_allocator<T2>& rhs) noexcept {
-
94  return !(lhs == rhs);
-
95 }
-
96 
-
97 } // namespace arrow
-
98 
-
99 #endif // ARROW_ALLOCATOR_H
-
void destroy(U *p)
Definition: allocator.h:77
-
virtual Status Allocate(int64_t size, uint8_t **out)=0
Allocate a new memory region of at least size bytes.
+Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_ALLOCATOR_H
19 #define ARROW_ALLOCATOR_H
20 
21 #include <cstddef>
22 #include <memory>
23 #include <utility>
24 
25 #include "arrow/memory_pool.h"
26 #include & quot;arrow/status.h"
27 
28 namespace arrow {
29 
30 template <class T>
32  pu blic:
33  using value_type = T;
34  using pointer = T*;
35  using const_pointer = const T*;
36  using reference = T&;
37  using const_reference = const T&;
38  using size_type = std::size_t;
39  using difference_type = std::ptrdiff_t;
40 
41  template <class U>
42  struct rebind {
44  };
45 
46  stl_allocator() noexcept : pool_(default_memory_pool()) {}
47  explicit stl_allocator(MemoryPool* pool) noexcept : pool_(pool) {}
48 
49  template <class U>
50  stl_allocator(const stl_allocator<U>& rhs) noexcept : pool_(rhs.pool_) {}
51 
52  ~stl_allocator() { pool_ = nullptr; }
53 
54  pointer address(reference r) const noexcept { return std::addressof(r); }
55 
56  const_pointer address(const_reference r) const noexcept { return std::addressof(r); }
57 
58  pointer allocate(size_type n, const void* /*hint*/ = nullptr) {
59  uint8_t* data;
60  Status s = pool_->Allocate(n * sizeof(T), &data);
61  if (!s.ok()) throw std::bad_alloc();
62  return reinterpret_cast<pointer>(data);
63  }
64 
66  pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T));
67  }
68 
69  size_type size_max() const noexcept { return size_type(-1) / sizeof(T); }
70 
71  template <class U, class... Args>
72  void cons truct(U* p, Args&&... args) {
73  new (reinterpret_cast<void*>(p)) U(std::forward<Args>(args)...);
74  }
75 
76  template <class U>
77  void destroy(U* p) {
78  p->~U();
79  }
80 
81  MemoryPool* pool() const noexcept { return pool_; }
82 
83  private:
84  MemoryPool* pool_;
85 };
86 
87 template <class T1, class T2>
88 bool operator==(const stl_allocator<T1>& lhs, const stl_allocator<T2>& rhs) noexcept {
89  return lhs.pool() == rhs.pool();
90 }
91 
92 template <class T1, class T2>
93 bool operator!=(const stl_allocator<T1>& lhs, const stl_allocator<T2>& rhs) noexcept {
94  return !(lhs == rhs);
95 }
96 
97 } // namespace arrow
98 
99 #endif // ARROW_ALLOCATOR_H
arrow::stl_allocator::destroy
void destroy(U *p)
Definition: allocator.h:77
pointer allocate(size_type n, const void *=nullptr)
Definition: allocator.h:58
const T * const_pointer
Definition: allocator.h:35
const_pointer address(const_reference r) const noexcept
Definition: allocator.h:56
@@ -198,34 +75,34 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
T * pointer
Definition: allocator.h:34
std::size_t size_type
Definition: allocator.h:38
Definition: status.h:88
+
bool ok() const
Definition: status.h:133
stl_allocator(const stl_allocator< U > &rhs) noexcept
Definition: allocator.h:50
bool operator!=(const stl_allocator< T1 > &lhs, const stl_allocator< T2 > &rhs) noexcept
Definition: allocator.h:93
Definition: allocator.h:42
size_type size_max() const noexcept
Definition: allocator.h:69
+
Public API for the "Feather" file format, originally created at http://github.com/wesm/feather.
Definition: allocator.h:28
MemoryPool * pool() const noexcept
Definition: allocator.h:81
Definition: allocator.h:31
~stl_allocator()
Definition: allocator.h:52
T & reference
Definition: allocator.h:36
const T & const_reference
Definition: allocator.h:37
-
virtual void Free(uint8_t *buffer, int64_t size)=0
Free an allocated region.
void deallocate(pointer p, size_type n)
Definition: allocator.h:65
-
void construct(U *p, Args &&...args)
Definition: allocator.h:72
bool operator==(const stl_allocator< T1 > &lhs, const stl_allocator< T2 > &rhs) noexcept
Definition: allocator.h:88
std::ptrdiff_t difference_type
Definition: allocator.h:39
pointer address(reference r) const noexcept
Definition: allocator.h:54
Base class for memory allocation.
Definition: memory_pool.h:35
stl_allocator(MemoryPool *pool) noexcept
Definition: allocator.h:47
+
void construct(U *p, Args &&... args)
Definition: allocator.h:72
stl_allocator() noexcept
Definition: allocator.h:46
-
bool ok() const
Definition: status.h:134
MemoryPool * default_memory_pool()
Definition: memory_pool.cc:133