about summary refs log tree commit diff
path: root/src/rt/rust_log.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2010-10-11 17:11:59 -0700
committerPatrick Walton <pcwalton@mimiga.net>2010-10-11 17:11:59 -0700
commit5177898db10de8903b28a45fa0452b4ba8dfaf36 (patch)
treed89497eef4f672dd05a2af488d4f496f815f6d7f /src/rt/rust_log.cpp
parent94cec74096280509083798bfcbd1be169fd43562 (diff)
downloadrust-5177898db10de8903b28a45fa0452b4ba8dfaf36.tar.gz
rust-5177898db10de8903b28a45fa0452b4ba8dfaf36.zip
Use new and delete instead of alloca(). Should put out the burning tinderbox.
Diffstat (limited to 'src/rt/rust_log.cpp')
-rw-r--r--src/rt/rust_log.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index 74a5d00ef12..20f3f146a88 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -8,14 +8,13 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
-#include <alloca.h>
 
 static uint32_t
 read_type_bit_mask() {
     uint32_t bits = rust_log::ULOG | rust_log::ERR;
     char *env_str = getenv("RUST_LOG");
     if (env_str) {
-        char *str = (char *)alloca(strlen(env_str) + 2);
+        char *str = new char[strlen(env_str) + 2];
         str[0] = ',';
         strcpy(str + 1, env_str);
 
@@ -38,6 +37,8 @@ read_type_bit_mask() {
         bits |= strstr(str, ",bt") ? rust_log::BT : 0;
         bits |= strstr(str, ",all") ? rust_log::ALL : 0;
         bits = strstr(str, ",none") ? 0 : bits;
+
+        delete[] str;
     }
     return bits;
 }