Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/kernel/boot.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/kernel/boot.c

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

revision 1224, Thu May 23 18:57:32 2002 UTC revision 1225, Thu May 23 18:57:57 2002 UTC
# Line 71  Line 71 
71      BinFileList = BuildFileList (msp, bootlist, &max_boot_path_len);      BinFileList = BuildFileList (msp, bootlist, &max_boot_path_len);
72    
73    /* this space is ultimately wasted */    /* this space is ultimately wasted */
74      if ((fname = malloc (max_boot_path_len)) == NULL)      if ((fname = MALLOC (max_boot_path_len)) == NULL)
75        Die ("unable to allocate space for boot file names");        Die ("unable to allocate space for boot file names");
76    
77    /* boot the system */    /* boot the system */
# Line 80  Line 80 
80         * going to scribble into it */         * going to scribble into it */
81          strcpy(fname, STR_MLtoC(LIST_hd(BinFileList)));          strcpy(fname, STR_MLtoC(LIST_hd(BinFileList)));
82          BinFileList = LIST_tl(BinFileList);          BinFileList = LIST_tl(BinFileList);
83          if (fname[0] == '#')          if (fname[0] == '#') {
84            if (rts_init)            if (rts_init)
85              Die ("runtime system registered more than once\n");              Die ("runtime system registered more than once\n");
86            else {            else {
# Line 100  Line 100 
100              EnterPerID (msp, &pid, RunTimeCompUnit);              EnterPerID (msp, &pid, RunTimeCompUnit);
101              rts_init = 1;       /* make sure we do this only once */              rts_init = 1;       /* make sure we do this only once */
102            }            }
103            }
104          else          else
105            LoadBinFile (msp, fname);            LoadBinFile (msp, fname);
106      }      }
# Line 140  Line 141 
141            *space = '\0';            *space = '\0';
142            max_num_boot_files = strtoul (sizeBuf, NULL, 0);            max_num_boot_files = strtoul (sizeBuf, NULL, 0);
143            max_boot_path_len = strtoul (space+1, NULL, 0) + 2;            max_boot_path_len = strtoul (space+1, NULL, 0) + 2;
144          } else              }
145                else
146            Die ("unable to read first line in \"%s\" after %%", bootlist);            Die ("unable to read first line in \"%s\" after %%", bootlist);
147        } else {          }
148            else {
149          /* size spec is missing -- use defaults */          /* size spec is missing -- use defaults */
150          ungetc (c, listF);          ungetc (c, listF);
151        }        }
152    
153        *mbplp = max_boot_path_len; /* tell the calling function... */        *mbplp = max_boot_path_len; /* tell the calling function... */
154    
155        if ((nameBuf = malloc (max_boot_path_len)) == NULL)          if ((nameBuf = MALLOC(max_boot_path_len)) == NIL(char *))
156          Die ("unable to allocate space for boot file names");          Die ("unable to allocate space for boot file names");
157    
158        if ((fileNames = malloc (max_num_boot_files * sizeof (char *))) == NULL)          if ((fileNames = MALLOC(max_num_boot_files * sizeof(char *))) == NULL)
159          Die ("unable to allocate space for boot file name table");          Die ("unable to allocate space for boot file name table");
160    
161        /* read in the file names, converting them to ML strings. */        /* read in the file names, converting them to ML strings. */
# Line 174  Line 177 
177    
178      /* these guys are no longer needed from now on */      /* these guys are no longer needed from now on */
179      if (fileNames)      if (fileNames)
180        free (fileNames);          FREE (fileNames);
181      if (nameBuf)      if (nameBuf)
182        free (nameBuf);          FREE (nameBuf);
183    
184      return fileList;      return fileList;
185    

Legend:
Removed from v.1224  
changed lines
  Added in v.1225

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0