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

Side by Side Diff: src/allocation.cc

Issue 2108273003: Strictly disable instantiation of AllStatic class (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Strictly disable instantiation of AllStatic class Created 4 years, 5 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
« no previous file with comments | « src/allocation.h ('k') | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project 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 #include "src/allocation.h" 5 #include "src/allocation.h"
6 6
7 #include <stdlib.h> // For free, malloc. 7 #include <stdlib.h> // For free, malloc.
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 28 matching lines...) Expand all
39 void* Embedded::operator new(size_t size) { 39 void* Embedded::operator new(size_t size) {
40 UNREACHABLE(); 40 UNREACHABLE();
41 return invalid; 41 return invalid;
42 } 42 }
43 43
44 44
45 void Embedded::operator delete(void* p) { 45 void Embedded::operator delete(void* p) {
46 UNREACHABLE(); 46 UNREACHABLE();
47 } 47 }
48 48
49
50 void* AllStatic::operator new(size_t size) {
51 UNREACHABLE();
52 return invalid;
53 }
54
55
56 void AllStatic::operator delete(void* p) {
57 UNREACHABLE();
58 }
59
60 #endif 49 #endif
61 50
62 51
63 char* StrDup(const char* str) { 52 char* StrDup(const char* str) {
64 int length = StrLength(str); 53 int length = StrLength(str);
65 char* result = NewArray<char>(length + 1); 54 char* result = NewArray<char>(length + 1);
66 MemCopy(result, str, length); 55 MemCopy(result, str, length);
67 result[length] = '\0'; 56 result[length] = '\0';
68 return result; 57 return result;
69 } 58 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 #elif V8_LIBC_BIONIC 92 #elif V8_LIBC_BIONIC
104 // Using free is not correct in general, but for V8_LIBC_BIONIC it is. 93 // Using free is not correct in general, but for V8_LIBC_BIONIC it is.
105 free(ptr); 94 free(ptr);
106 #else 95 #else
107 free(ptr); 96 free(ptr);
108 #endif 97 #endif
109 } 98 }
110 99
111 } // namespace internal 100 } // namespace internal
112 } // namespace v8 101 } // namespace v8
OLDNEW
« no previous file with comments | « src/allocation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698