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

Side by Side Diff: src/allocation.h

Issue 6800003: Make object groups and implicit references a bit more lightweight. (Closed)
Patch Set: Created 9 years, 8 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 | « no previous file | src/api.cc » ('j') | src/global-handles.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 public: 44 public:
45 void* operator new(size_t size) { return New(size); } 45 void* operator new(size_t size) { return New(size); }
46 void operator delete(void* p) { Delete(p); } 46 void operator delete(void* p) { Delete(p); }
47 47
48 static void FatalProcessOutOfMemory(); 48 static void FatalProcessOutOfMemory();
49 static void* New(size_t size); 49 static void* New(size_t size);
50 static void Delete(void* p); 50 static void Delete(void* p);
51 }; 51 };
52 52
53 53
54 // Superclass for classes with custom allocation.
55 class CustomlyAllocated {
antonm 2011/04/06 11:01:48 I don't like the name, but I cannot come up with a
Vitaly Repeshko 2011/04/06 19:11:01 Yeah, since it requires hiding both new/delete and
56 private:
57 void* operator new(size_t size);
58 void operator delete(void* p);
59 };
60
61
54 // A macro is used for defining the base class used for embedded instances. 62 // A macro is used for defining the base class used for embedded instances.
55 // The reason is some compilers allocate a minimum of one word for the 63 // The reason is some compilers allocate a minimum of one word for the
56 // superclass. The macro prevents the use of new & delete in debug mode. 64 // superclass. The macro prevents the use of new & delete in debug mode.
57 // In release mode we are not willing to pay this overhead. 65 // In release mode we are not willing to pay this overhead.
58 66
59 #ifdef DEBUG 67 #ifdef DEBUG
60 // Superclass for classes with instances allocated inside stack 68 // Superclass for classes with instances allocated inside stack
61 // activations or inside other objects. 69 // activations or inside other objects.
62 class Embedded { 70 class Embedded {
63 public: 71 public:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 142
135 friend class Isolate; 143 friend class Isolate;
136 144
137 DISALLOW_IMPLICIT_CONSTRUCTORS(PreallocatedStorage); 145 DISALLOW_IMPLICIT_CONSTRUCTORS(PreallocatedStorage);
138 }; 146 };
139 147
140 148
141 } } // namespace v8::internal 149 } } // namespace v8::internal
142 150
143 #endif // V8_ALLOCATION_H_ 151 #endif // V8_ALLOCATION_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/global-handles.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698