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

Side by Side Diff: src/zone-inl.h

Issue 12826: RegExp stack and zone limits. (Closed)
Patch Set: Created 12 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 30 matching lines...) Expand all
41 // Check if the requested size is available without expanding. 41 // Check if the requested size is available without expanding.
42 Address result = position_; 42 Address result = position_;
43 if ((position_ += size) > limit_) result = NewExpand(size); 43 if ((position_ += size) > limit_) result = NewExpand(size);
44 44
45 // Check that the result has the proper alignment and return it. 45 // Check that the result has the proper alignment and return it.
46 ASSERT(IsAddressAligned(result, kAlignment, 0)); 46 ASSERT(IsAddressAligned(result, kAlignment, 0));
47 return reinterpret_cast<void*>(result); 47 return reinterpret_cast<void*>(result);
48 } 48 }
49 49
50 50
51 bool Zone::excess_allocation() {
52 return segment_bytes_allocated_ > zone_excess_limit_;
53 }
54
55
51 } } // namespace v8::internal 56 } } // namespace v8::internal
52 57
53 #endif // V8_ZONE_INL_H_ 58 #endif // V8_ZONE_INL_H_
OLDNEW
« src/parser.cc ('K') | « src/zone.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698