| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | #ifndef _OS_COMMON_H_ | - |
| 21 | #define _OS_COMMON_H_ | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | #ifdef MEMORY_DEBUG | - |
| 29 | # error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead." | - |
| 30 | #endif | - |
| 31 | | - |
| 32 | | - |
| 33 | | - |
| 34 | | - |
| 35 | | - |
| 36 | #ifdef SQLITE_PERFORMANCE_TRACE | - |
| 37 | | - |
| 38 | | - |
| 39 | | - |
| 40 | | - |
| 41 | | - |
| 42 | #include "hwtime.h" | - |
| 43 | | - |
| 44 | static sqlite_uint64 g_start; | - |
| 45 | static sqlite_uint64 g_elapsed; | - |
| 46 | #define TIMER_START g_start=sqlite3Hwtime() | - |
| 47 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start | - |
| 48 | #define TIMER_ELAPSED g_elapsed | - |
| 49 | #else | - |
| 50 | #define TIMER_START | - |
| 51 | #define TIMER_END | - |
| 52 | #define TIMER_ELAPSED ((sqlite_uint64)0) | - |
| 53 | #endif | - |
| 54 | | - |
| 55 | | - |
| 56 | | - |
| 57 | | - |
| 58 | | - |
| 59 | | - |
| 60 | #if defined(SQLITE_TEST) | - |
| 61 | extern int sqlite3_io_error_hit; | - |
| 62 | extern int sqlite3_io_error_hardhit; | - |
| 63 | extern int sqlite3_io_error_pending; | - |
| 64 | extern int sqlite3_io_error_persist; | - |
| 65 | extern int sqlite3_io_error_benign; | - |
| 66 | extern int sqlite3_diskfull_pending; | - |
| 67 | extern int sqlite3_diskfull; | - |
| 68 | #define SimulateIOErrorBenign(X) sqlite3_io_error_benign=(X) | - |
| 69 | #define SimulateIOError(CODE) \ | - |
| 70 | if( (sqlite3_io_error_persist && sqlite3_io_error_hit) \ | - |
| 71 | || sqlite3_io_error_pending-- == 1 ) \ | - |
| 72 | { local_ioerr(); CODE; } | - |
| 73 | static void local_ioerr(){ | - |
| 74 | IOTRACE(("IOERR\n")); | - |
| 75 | sqlite3_io_error_hit++; | - |
| 76 | if( !sqlite3_io_error_benign ) sqlite3_io_error_hardhit++;executed 768 times by 1 test: sqlite3_io_error_hardhit++; | TRUE | evaluated 768 times by 1 test | | FALSE | never evaluated |
| 0-768 |
| 77 | }executed 768 times by 1 test: end of block | 768 |
| 78 | #define SimulateDiskfullError(CODE) \ | - |
| 79 | if( sqlite3_diskfull_pending ){ \ | - |
| 80 | if( sqlite3_diskfull_pending == 1 ){ \ | - |
| 81 | local_ioerr(); \ | - |
| 82 | sqlite3_diskfull = 1; \ | - |
| 83 | sqlite3_io_error_hit = 1; \ | - |
| 84 | CODE; \ | - |
| 85 | }else{ \ | - |
| 86 | sqlite3_diskfull_pending--; \ | - |
| 87 | } \ | - |
| 88 | } | - |
| 89 | #else | - |
| 90 | #define SimulateIOErrorBenign(X) | - |
| 91 | #define SimulateIOError(A) | - |
| 92 | #define SimulateDiskfullError(A) | - |
| 93 | #endif /* defined(SQLITE_TEST) */ | - |
| 94 | | - |
| 95 | | - |
| 96 | | - |
| 97 | | - |
| 98 | #if defined(SQLITE_TEST) | - |
| 99 | extern int sqlite3_open_file_count; | - |
| 100 | #define OpenCounter(X) sqlite3_open_file_count+=(X) | - |
| 101 | #else | - |
| 102 | #define OpenCounter(X) | - |
| 103 | #endif /* defined(SQLITE_TEST) */ | - |
| 104 | | - |
| 105 | #endif /* !defined(_OS_COMMON_H_) */ | - |
| | |