| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 __attribute__((weak_import)); | 72 __attribute__((weak_import)); |
| 73 extern void backtrace_symbols_fd(void* const*, int, int) | 73 extern void backtrace_symbols_fd(void* const*, int, int) |
| 74 __attribute__((weak_import)); | 74 __attribute__((weak_import)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 namespace v8 { | 78 namespace v8 { |
| 79 namespace internal { | 79 namespace internal { |
| 80 | 80 |
| 81 | 81 |
| 82 double ceiling(double x) { | |
| 83 // Correct Mac OS X Leopard 'ceil' behavior. | |
| 84 if (-1.0 < x && x < 0.0) { | |
| 85 return -0.0; | |
| 86 } else { | |
| 87 return ceil(x); | |
| 88 } | |
| 89 } | |
| 90 | |
| 91 | |
| 92 static Mutex* limit_mutex = NULL; | 82 static Mutex* limit_mutex = NULL; |
| 93 | 83 |
| 94 | 84 |
| 95 // We keep the lowest and highest addresses mapped as a quick way of | 85 // We keep the lowest and highest addresses mapped as a quick way of |
| 96 // determining that pointers are outside the heap (used mostly in assertions | 86 // determining that pointers are outside the heap (used mostly in assertions |
| 97 // and verification). The estimate is conservative, i.e., not all addresses in | 87 // and verification). The estimate is conservative, i.e., not all addresses in |
| 98 // 'allocated' space are actually allocated to our heap. The range is | 88 // 'allocated' space are actually allocated to our heap. The range is |
| 99 // [lowest, highest), inclusive on the low and and exclusive on the high end. | 89 // [lowest, highest), inclusive on the low and and exclusive on the high end. |
| 100 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); | 90 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); |
| 101 static void* highest_ever_allocated = reinterpret_cast<void*>(0); | 91 static void* highest_ever_allocated = reinterpret_cast<void*>(0); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 limit_mutex = CreateMutex(); | 461 limit_mutex = CreateMutex(); |
| 472 } | 462 } |
| 473 | 463 |
| 474 | 464 |
| 475 void OS::TearDown() { | 465 void OS::TearDown() { |
| 476 delete limit_mutex; | 466 delete limit_mutex; |
| 477 } | 467 } |
| 478 | 468 |
| 479 | 469 |
| 480 } } // namespace v8::internal | 470 } } // namespace v8::internal |
| OLD | NEW |