Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: courgette/third_party/paged_array.h

Issue 1543643002: Switch to standard integer types in courgette/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « courgette/third_party/bsdiff_create.cc ('k') | courgette/third_party/qsufsort_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // PagedArray implements an array stored using many fixed-size pages. 5 // PagedArray implements an array stored using many fixed-size pages.
6 // 6 //
7 // PagedArray is a work-around to allow large arrays to be allocated when there 7 // PagedArray is a work-around to allow large arrays to be allocated when there
8 // is too much address space fragmentation for allocating the large arrays as 8 // is too much address space fragmentation for allocating the large arrays as
9 // contigous arrays. 9 // contigous arrays.
10 10
11 #ifndef COURGETTE_BSDIFF_PAGED_ARRAY_H_ 11 #ifndef COURGETTE_BSDIFF_PAGED_ARRAY_H_
12 #define COURGETTE_BSDIFF_PAGED_ARRAY_H_ 12 #define COURGETTE_BSDIFF_PAGED_ARRAY_H_
13 13
14 #include "base/basictypes.h" 14 #include <stddef.h>
15
16 #include "base/macros.h"
15 #include "base/process/memory.h" 17 #include "base/process/memory.h"
16 18
17 namespace courgette { 19 namespace courgette {
18 20
19 // PagedArray implements an array stored using many fixed-size pages. 21 // PagedArray implements an array stored using many fixed-size pages.
20 template<typename T> 22 template<typename T>
21 class PagedArray { 23 class PagedArray {
22 enum { 24 enum {
23 // Page size in elements. Page size of 2^18 * sizeof(T) is 1MB for T = int. 25 // Page size in elements. Page size of 2^18 * sizeof(T) is 1MB for T = int.
24 kLogPageSize = 18, 26 kLogPageSize = 18,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 75 }
74 76
75 private: 77 private:
76 T** pages_; 78 T** pages_;
77 size_t page_count_; 79 size_t page_count_;
78 80
79 DISALLOW_COPY_AND_ASSIGN(PagedArray); 81 DISALLOW_COPY_AND_ASSIGN(PagedArray);
80 }; 82 };
81 } // namespace 83 } // namespace
82 #endif // COURGETTE_BSDIFF_PAGED_ARRAY_H_ 84 #endif // COURGETTE_BSDIFF_PAGED_ARRAY_H_
OLDNEW
« no previous file with comments | « courgette/third_party/bsdiff_create.cc ('k') | courgette/third_party/qsufsort_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698