Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 688 } | 688 } |
| 689 | 689 |
| 690 | 690 |
| 691 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { | 691 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { |
| 692 int result = strncpy_s(dest.start(), dest.length(), src, n); | 692 int result = strncpy_s(dest.start(), dest.length(), src, n); |
| 693 USE(result); | 693 USE(result); |
| 694 ASSERT(result == 0); | 694 ASSERT(result == 0); |
| 695 } | 695 } |
| 696 | 696 |
| 697 | 697 |
| 698 char *OS::StrDup(const char* str) { | 698 char* OS::StrDup(const char* str) { |
|
Erik Corry
2008/12/03 13:43:22
Wot no strndup?
| |
| 699 return _strdup(str); | 699 return _strdup(str); |
| 700 } | 700 } |
| 701 | 701 |
| 702 | 702 |
| 703 // We keep the lowest and highest addresses mapped as a quick way of | 703 // We keep the lowest and highest addresses mapped as a quick way of |
| 704 // determining that pointers are outside the heap (used mostly in assertions | 704 // determining that pointers are outside the heap (used mostly in assertions |
| 705 // and verification). The estimate is conservative, ie, not all addresses in | 705 // and verification). The estimate is conservative, ie, not all addresses in |
| 706 // 'allocated' space are actually allocated to our heap. The range is | 706 // 'allocated' space are actually allocated to our heap. The range is |
| 707 // [lowest, highest), inclusive on the low and and exclusive on the high end. | 707 // [lowest, highest), inclusive on the low and and exclusive on the high end. |
| 708 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); | 708 static void* lowest_ever_allocated = reinterpret_cast<void*>(-1); |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1578 | 1578 |
| 1579 // Release the thread handles | 1579 // Release the thread handles |
| 1580 CloseHandle(data_->sampler_thread_); | 1580 CloseHandle(data_->sampler_thread_); |
| 1581 CloseHandle(data_->profiled_thread_); | 1581 CloseHandle(data_->profiled_thread_); |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 | 1584 |
| 1585 #endif // ENABLE_LOGGING_AND_PROFILING | 1585 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1586 | 1586 |
| 1587 } } // namespace v8::internal | 1587 } } // namespace v8::internal |
| OLD | NEW |