comparison src/ralloc.c @ 1013:6bf2c4766d4c

* ralloc.c (get_bloc): When initializing new_bloc->variable, cast NIL to (POINTER *). (malloc_init): Give warning if sbrk returns zero. Wonder what that's supposed to mean.
author Jim Blandy <jimb@redhat.com>
date Wed, 19 Aug 1992 06:36:35 +0000
parents 64e152d639af
children 6c410cc87574
comparison
equal deleted inserted replaced
1012:a48ed1d416dd 1013:6bf2c4766d4c
223 register bloc_ptr new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE); 223 register bloc_ptr new_bloc = (bloc_ptr) malloc (BLOC_PTR_SIZE);
224 224
225 new_bloc->data = get_more_space (size); 225 new_bloc->data = get_more_space (size);
226 new_bloc->size = size; 226 new_bloc->size = size;
227 new_bloc->next = NIL_BLOC; 227 new_bloc->next = NIL_BLOC;
228 new_bloc->variable = NIL; 228 new_bloc->variable = (POINTER *) NIL;
229 229
230 if (first_bloc) 230 if (first_bloc)
231 { 231 {
232 new_bloc->prev = last_bloc; 232 new_bloc->prev = last_bloc;
233 last_bloc->next = new_bloc; 233 last_bloc->next = new_bloc;
435 if (malloc_initialized) 435 if (malloc_initialized)
436 return; 436 return;
437 437
438 malloc_initialized = 1; 438 malloc_initialized = 1;
439 __morecore = r_alloc_sbrk; 439 __morecore = r_alloc_sbrk;
440
440 virtual_break_value = break_value = sbrk (0); 441 virtual_break_value = break_value = sbrk (0);
442 if (break_value == (POINTER)NULL)
443 (*warn_func)("Malloc initialization returned 0 from sbrk(0).");
444
441 page_break_value = (POINTER) ROUNDUP (break_value); 445 page_break_value = (POINTER) ROUNDUP (break_value);
442 bzero (break_value, (page_break_value - break_value)); 446 bzero (break_value, (page_break_value - break_value));
443 use_relocatable_buffers = 1; 447 use_relocatable_buffers = 1;
444 448
445 lim_data = 0; 449 lim_data = 0;