mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	lib min_heap: Switch to size_t
size_t is the correct type for a count of objects that can fit in memory: this also means heaps now have the same memory layout as darrays (fs/bcachefs/darray.h), and darrays can be used as heaps. Cc: Kuan-Wei Chiu <visitorckw@gmail.com> Cc: Ian Rogers <irogers@google.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Coly Li <colyli@suse.de> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
		
							parent
							
								
									fbd152bf94
								
							
						
					
					
						commit
						dec6c0aac4
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -15,8 +15,8 @@
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define MIN_HEAP_PREALLOCATED(_type, _name, _nr)	\
 | 
					#define MIN_HEAP_PREALLOCATED(_type, _name, _nr)	\
 | 
				
			||||||
struct _name {	\
 | 
					struct _name {	\
 | 
				
			||||||
	int nr;	\
 | 
						size_t nr;	\
 | 
				
			||||||
	int size;	\
 | 
						size_t size;	\
 | 
				
			||||||
	_type *data;	\
 | 
						_type *data;	\
 | 
				
			||||||
	_type preallocated[_nr];	\
 | 
						_type preallocated[_nr];	\
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue