OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_FASTALLOC_H_ | 5 #ifndef CHROME_COMMON_NET_NOTIFIER_BASE_FASTALLOC_H_ |
6 #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_FASTALLOC_H_ | 6 #define CHROME_COMMON_NET_NOTIFIER_BASE_FASTALLOC_H_ |
7 | 7 |
8 #include <assert.h> | 8 #include <assert.h> |
9 | 9 |
10 namespace notifier { | 10 namespace notifier { |
11 | 11 |
12 template<class T, size_t Size> | 12 template<class T, size_t Size> |
13 class FastAlloc { | 13 class FastAlloc { |
14 public: | 14 public: |
15 FastAlloc() : buffer_(NULL), size_(0) { } | 15 FastAlloc() : buffer_(NULL), size_(0) { } |
16 ~FastAlloc() { freeBuffer(); } | 16 ~FastAlloc() { freeBuffer(); } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 size_ = 0; | 49 size_ = 0; |
50 } | 50 } |
51 | 51 |
52 T* buffer_; | 52 T* buffer_; |
53 T internal_buffer_[Size]; | 53 T internal_buffer_[Size]; |
54 size_t size_; | 54 size_t size_; |
55 }; | 55 }; |
56 | 56 |
57 } | 57 } |
58 | 58 |
59 #endif // CHROME_BROWSER_SYNC_NOTIFIER_BASE_FASTALLOC_H_ | 59 #endif // CHROME_COMMON_NET_NOTIFIER_BASE_FASTALLOC_H_ |
OLD | NEW |