mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 15:38:57 +08:00 
			
		
		
		
	mdbx: refine testing-jitter, add MDBX_DBG_JITTER.
Change-Id: Ibc3bd8a16626e97aabc2cc544a3803f2e2bc3a10
This commit is contained in:
		
				
					committed by
					
						 Leo Yuriev
						Leo Yuriev
					
				
			
			
				
	
			
			
			
						parent
						
							009618560f
						
					
				
				
					commit
					e7ee0bc762
				
			
							
								
								
									
										1
									
								
								mdbx.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								mdbx.h
									
									
									
									
									
								
							| @@ -1550,6 +1550,7 @@ LIBMDBX_API MDBX_oom_func *mdbx_env_get_oomfunc(MDBX_env *env); | |||||||
| #define MDBX_DBG_TRACE 4 | #define MDBX_DBG_TRACE 4 | ||||||
| #define MDBX_DBG_EXTRA 8 | #define MDBX_DBG_EXTRA 8 | ||||||
| #define MDBX_DBG_AUDIT 16 | #define MDBX_DBG_AUDIT 16 | ||||||
|  | #define MDBX_DBG_JITTER 32 | ||||||
|  |  | ||||||
| typedef void MDBX_debug_func(int type, const char *function, int line, | typedef void MDBX_debug_func(int type, const char *function, int line, | ||||||
|                              const char *msg, va_list args); |                              const char *msg, va_list args); | ||||||
|   | |||||||
| @@ -792,6 +792,7 @@ void mdbx_panic(const char *fmt, ...) | |||||||
|  |  | ||||||
| static __inline void mdbx_jitter4testing(bool tiny) { | static __inline void mdbx_jitter4testing(bool tiny) { | ||||||
| #ifndef NDEBUG | #ifndef NDEBUG | ||||||
|  |   if (MDBX_DBG_JITTER & mdbx_runtime_flags) | ||||||
|     mdbx_osal_jitter(tiny); |     mdbx_osal_jitter(tiny); | ||||||
| #else | #else | ||||||
|   (void)tiny; |   (void)tiny; | ||||||
|   | |||||||
| @@ -114,7 +114,7 @@ void testcase::db_prepare() { | |||||||
|   log_trace(">> db_prepare"); |   log_trace(">> db_prepare"); | ||||||
|   assert(!db_guard); |   assert(!db_guard); | ||||||
|  |  | ||||||
|   int mdbx_dbg_opts = MDBX_DBG_ASSERT; |   int mdbx_dbg_opts = MDBX_DBG_ASSERT | MDBX_DBG_JITTER; | ||||||
|   if (config.params.loglevel <= logging::trace) |   if (config.params.loglevel <= logging::trace) | ||||||
|     mdbx_dbg_opts |= MDBX_DBG_TRACE; |     mdbx_dbg_opts |= MDBX_DBG_TRACE; | ||||||
|   if (config.params.loglevel <= logging::verbose) |   if (config.params.loglevel <= logging::verbose) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user