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

Side by Side Diff: net/quic/core/quic_one_block_arena.h

Issue 2619993003: Move quic_bug_tracker to quic/platform. No functional change expected. (Closed)
Patch Set: fix two includes Created 3 years, 11 months 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 // An arena that consists of a single inlined block of |ArenaSize|. Useful to 5 // An arena that consists of a single inlined block of |ArenaSize|. Useful to
6 // avoid repeated calls to malloc/new and to improve memory locality. DCHECK's 6 // avoid repeated calls to malloc/new and to improve memory locality. DCHECK's
7 // if an allocation out of the arena ever fails in debug builds; falls back to 7 // if an allocation out of the arena ever fails in debug builds; falls back to
8 // heap allocation in release builds. 8 // heap allocation in release builds.
9 9
10 #ifndef NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_ 10 #ifndef NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_
11 #define NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_ 11 #define NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_
12 12
13 #include <cstdint> 13 #include <cstdint>
14 14
15 #include "net/quic/core/quic_arena_scoped_ptr.h" 15 #include "net/quic/core/quic_arena_scoped_ptr.h"
16 #include "net/quic/core/quic_bug_tracker.h"
17 #include "net/quic/core/quic_types.h" 16 #include "net/quic/core/quic_types.h"
17 #include "net/quic/platform/api/quic_bug_tracker.h"
18 18
19 #define PREDICT_FALSE(x) x 19 #define PREDICT_FALSE(x) x
20 20
21 namespace net { 21 namespace net {
22 22
23 template <uint32_t ArenaSize> 23 template <uint32_t ArenaSize>
24 class QuicOneBlockArena { 24 class QuicOneBlockArena {
25 static const uint32_t kMaxAlign = 8; 25 static const uint32_t kMaxAlign = 8;
26 26
27 public: 27 public:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void* buf = &storage_[offset_]; 70 void* buf = &storage_[offset_];
71 new (buf) T(std::forward<Args>(args)...); 71 new (buf) T(std::forward<Args>(args)...);
72 offset_ += AlignedSize<T>(); 72 offset_ += AlignedSize<T>();
73 return QuicArenaScopedPtr<T>(buf, 73 return QuicArenaScopedPtr<T>(buf,
74 QuicArenaScopedPtr<T>::ConstructFrom::kArena); 74 QuicArenaScopedPtr<T>::ConstructFrom::kArena);
75 } 75 }
76 76
77 } // namespace net 77 } // namespace net
78 78
79 #endif // NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_ 79 #endif // NET_QUIC_CORE_QUIC_ONE_BLOCK_ARENA_H_
OLDNEW
« no previous file with comments | « net/quic/core/quic_multipath_sent_packet_manager_test.cc ('k') | net/quic/core/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698