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

Side by Side Diff: courgette/memory_allocator.h

Issue 2454673002: Add missing return statement to CheckReturnValue's copy assignment operator. (Closed)
Patch Set: sync to position 433806 Created 4 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 COURGETTE_MEMORY_ALLOCATOR_H_ 5 #ifndef COURGETTE_MEMORY_ALLOCATOR_H_
6 #define COURGETTE_MEMORY_ALLOCATOR_H_ 6 #define COURGETTE_MEMORY_ALLOCATOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 18 matching lines...) Expand all
29 other.checked_ = true; 29 other.checked_ = true;
30 } 30 }
31 31
32 CheckReturnValue& operator=(const CheckReturnValue& other) { 32 CheckReturnValue& operator=(const CheckReturnValue& other) {
33 if (this != &other) { 33 if (this != &other) {
34 DCHECK(checked_); 34 DCHECK(checked_);
35 value_ = other.value_; 35 value_ = other.value_;
36 checked_ = other.checked_; 36 checked_ = other.checked_;
37 other.checked_ = true; 37 other.checked_ = true;
38 } 38 }
39 return *this;
39 } 40 }
40 41
41 ~CheckReturnValue() { 42 ~CheckReturnValue() {
42 DCHECK(checked_); 43 DCHECK(checked_);
43 } 44 }
44 45
45 operator const T&() const { 46 operator const T&() const {
46 checked_ = true; 47 checked_ = true;
47 return value_; 48 return value_;
48 } 49 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 protected: 498 protected:
498 T* buffer_; 499 T* buffer_;
499 size_t size_; // how much of the buffer we're using. 500 size_t size_; // how much of the buffer we're using.
500 size_t alloc_size_; // how much space we have allocated. 501 size_t alloc_size_; // how much space we have allocated.
501 Allocator alloc_; 502 Allocator alloc_;
502 }; 503 };
503 504
504 } // namespace courgette 505 } // namespace courgette
505 506
506 #endif // COURGETTE_MEMORY_ALLOCATOR_H_ 507 #endif // COURGETTE_MEMORY_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698