mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-10-30 07:05:46 +03:00 
			
		
		
		
	Remove the vestigial mem4 and mem6 memory allocators. Add the
SQLITE_ZERO_MALLOC compile-time option and the mem0.c module to handle memory allocation for that case. (CVS 5848) FossilOrigin-Name: 4651f590f0b8bf13938b2b15d5082136e763af8d
This commit is contained in:
		
							
								
								
									
										26
									
								
								src/mem5.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								src/mem5.c
									
									
									
									
									
								
							| @@ -23,38 +23,16 @@ | ||||
| ** This version of the memory allocation subsystem is included | ||||
| ** in the build only if SQLITE_ENABLE_MEMSYS5 is defined. | ||||
| ** | ||||
| ** $Id: mem5.c,v 1.14 2008/09/02 17:52:52 danielk1977 Exp $ | ||||
| ** $Id: mem5.c,v 1.15 2008/10/28 18:58:20 drh Exp $ | ||||
| */ | ||||
| #include "sqliteInt.h" | ||||
|  | ||||
| /* | ||||
| ** This version of the memory allocator is used only when  | ||||
| ** SQLITE_POW2_MEMORY_SIZE is defined. | ||||
| ** SQLITE_ENABLE_MEMSYS5 is defined. | ||||
| */ | ||||
| #ifdef SQLITE_ENABLE_MEMSYS5 | ||||
|  | ||||
| /* | ||||
| ** Log2 of the minimum size of an allocation.  For example, if | ||||
| ** 4 then all allocations will be rounded up to at least 16 bytes. | ||||
| ** If 5 then all allocations will be rounded up to at least 32 bytes. | ||||
| */ | ||||
| #ifndef SQLITE_POW2_LOGMIN | ||||
| # define SQLITE_POW2_LOGMIN 6 | ||||
| #endif | ||||
|  | ||||
| /* | ||||
| ** Log2 of the maximum size of an allocation. | ||||
| */ | ||||
| #ifndef SQLITE_POW2_LOGMAX | ||||
| # define SQLITE_POW2_LOGMAX 20 | ||||
| #endif | ||||
| #define POW2_MAX (((unsigned int)1)<<SQLITE_POW2_LOGMAX) | ||||
|  | ||||
| /* | ||||
| ** Number of distinct allocation sizes. | ||||
| */ | ||||
| #define NSIZE (SQLITE_POW2_LOGMAX - SQLITE_POW2_LOGMIN + 1) | ||||
|  | ||||
| /* | ||||
| ** A minimum allocation is an instance of the following structure. | ||||
| ** Larger allocations are an array of these structures where the | ||||
|   | ||||
		Reference in New Issue
	
	Block a user