diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-06 20:42:34 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-26 16:29:35 +0200 |
commit | b9255465eaceebc7c770d2793d0ad4eb447577be (patch) | |
tree | 98f671707d33798666ca8094118091c91eeb2ff7 /kern/bootstrap.c | |
parent | 7960290a67c945b6133b6e680a9bd2c241adfae4 (diff) |
xxx avoid alloca
Diffstat (limited to 'kern/bootstrap.c')
-rw-r--r-- | kern/bootstrap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c index aad0fb1..d95395c 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -177,8 +177,8 @@ void bootstrap_create(void) serverboot did, so an old Hurd and boot script previously used with serverboot can be used directly with this kernel. */ - char *flag_string = alloca(1024); - char *root_string = alloca(1024); + char *flag_string = kalloc(1024); + char *root_string = kalloc(1024); /* * Get the (compatibility) boot flags and root name strings. @@ -209,7 +209,7 @@ void bootstrap_create(void) for (ep = environ; *ep != 0; ++ep) { size_t len = strlen (*ep) + 1; - char *var = memcpy (alloca (len), *ep, len); + char *var = memcpy (kalloc (len), *ep, len); char *val = strchr (var, '='); *val++ = '\0'; losers = boot_script_set_variable (var, VAL_STR, (long) val); @@ -225,7 +225,7 @@ void bootstrap_create(void) oskit's environ in the oskit-mach case (above). */ int len = strlen (kernel_cmdline) + 1; - char *s = memcpy (alloca (len), kernel_cmdline, len); + char *s = memcpy (kalloc (len), kernel_cmdline, len); char *word; while ((word = strsep (&s, " \t")) != 0) { @@ -683,7 +683,7 @@ $0 ${boot-args} ${host-port} ${device-port} ${root-device} $(task-create) $(task if (kernel_cmdline[0] != '\0') { static const char cmdline_var[] = "MULTIBOOT_CMDLINE="; - envp[0] = alloca (sizeof cmdline_var + strlen (kernel_cmdline)); + envp[0] = kalloc (sizeof cmdline_var + strlen (kernel_cmdline)); memcpy (envp[0], cmdline_var, sizeof cmdline_var - 1); strcpy (envp[0] + sizeof cmdline_var - 1, kernel_cmdline); } |