123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include <out.h>
- #include <system.h>
- #include "back.h"
- #include "hash.h"
- #include <alloc.h>
- /* The routines allocate more space for the segments and update the
- * global variables. Each time the space asked for is multiplied with 2.
- */
- mem_text()
- {
- /* print( "text_area too small %d %d \n", text_area, text); */
- int diff = text - text_area;
- text_area = Realloc( text_area, sizeof( char) * 2 * size_text);
- text = text_area + diff;
- text_cnt += size_text;
- size_text = 2 * size_text;
- }
- mem_data()
- {
- /* print( "data_area too small\n"); */
- int diff = data - data_area;
- data_area = Realloc( data_area, sizeof( char) * 2 * size_data);
- data = data_area + diff;
- data_cnt += size_data;
- size_data = 2 * size_data;
- }
- mem_symbol_hash()
- {
- /* print( "symbol_table out of memory\n"); */
- size_symbol = 2 * size_symbol;
- symbol_table = (struct outname *) Realloc( (char *) symbol_table,
- sizeof( struct outname) * size_symbol);
- /* print( "hash out of memory\n"); */
- Hashitems = (struct Hashitem *) Realloc( (char *) Hashitems,
- sizeof( struct Hashitem)*(size_symbol+1));
- }
- mem_relo()
- {
- /* print( "reloc_table out of memory\n"); */
- int diff = relo - reloc_info;
- reloc_info = (struct outrelo *) Realloc( (char *) reloc_info,
- sizeof( struct outrelo) * 2 * size_reloc);
- relo = reloc_info + diff;
- size_reloc = 2 * size_reloc;
- }
- mem_string()
- {
- int diff = string - string_area;
- /* print( "string_area out of memory %d %d \n", string_area, string);*/
- size_string = 2 * size_string;
- string_area = Realloc( string_area, sizeof( char) * size_string);
- string = string_area + diff;
- }
|