/[hurd]/gnumach/kern/kalloc.c
ViewVC logotype

Diff of /gnumach/kern/kalloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by thomas, Tue Feb 25 21:28:23 1997 UTC revision 1.1.1.1.4.1 by ams, Wed Dec 1 06:10:11 2004 UTC
# Line 106  unsigned long k_zone_max[16] = { Line 106  unsigned long k_zone_max[16] = {
106   *      This initializes all of the zones.   *      This initializes all of the zones.
107   */   */
108    
109    #ifndef NDEBUG
110    static int kalloc_init_called;
111    #endif
112    
113  void kalloc_init()  void kalloc_init()
114  {  {
115          vm_offset_t min, max;          vm_offset_t min, max;
116          vm_size_t size;          vm_size_t size;
117          register int i;          register int i;
118    
119            assert (! kalloc_init_called);
120    
121          kalloc_map = kmem_suballoc(kernel_map, &min, &max,          kalloc_map = kmem_suballoc(kernel_map, &min, &max,
122                                     kalloc_map_size, FALSE);                                     kalloc_map_size, FALSE);
123    
# Line 142  void kalloc_init() Line 148  void kalloc_init()
148                                    size >= PAGE_SIZE ? ZONE_COLLECTABLE : 0,                                    size >= PAGE_SIZE ? ZONE_COLLECTABLE : 0,
149                                    k_zone_name[i]);                                    k_zone_name[i]);
150          }          }
151    
152    #ifndef NDEBUG
153            kalloc_init_called = 1;
154    #endif
155  }  }
156    
157  vm_offset_t kalloc(size)  vm_offset_t kalloc(size)
# Line 153  vm_offset_t kalloc(size) Line 163  vm_offset_t kalloc(size)
163    
164          /* compute the size of the block that we will actually allocate */          /* compute the size of the block that we will actually allocate */
165    
166            assert (kalloc_init_called);
167    
168          allocsize = size;          allocsize = size;
169          if (size < kalloc_max) {          if (size < kalloc_max) {
170                  allocsize = MINSIZE;                  allocsize = MINSIZE;
# Line 185  vm_offset_t kget(size) Line 197  vm_offset_t kget(size)
197          register vm_size_t allocsize;          register vm_size_t allocsize;
198          vm_offset_t addr;          vm_offset_t addr;
199    
200            assert (kalloc_init_called);
201    
202          /* compute the size of the block that we will actually allocate */          /* compute the size of the block that we will actually allocate */
203    
204          allocsize = size;          allocsize = size;
# Line 219  kfree(data, size) Line 233  kfree(data, size)
233          register int zindex;          register int zindex;
234          register vm_size_t freesize;          register vm_size_t freesize;
235    
236            assert (kalloc_init_called);
237    
238          freesize = size;          freesize = size;
239          if (size < kalloc_max) {          if (size < kalloc_max) {
240                  freesize = MINSIZE;                  freesize = MINSIZE;

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26