about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-08-22 22:11:30 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-23 14:46:23 -0700
commit74b2d9e19b2784aed009bd34aaeed43248944aca (patch)
treebd062d8b2a2507e9e3b13abc6f49e9c3b198fc7a /src/libextra
parent2c0f9bd35493def5e23f0f43ddeba54da9d788b4 (diff)
downloadrust-74b2d9e19b2784aed009bd34aaeed43248944aca.tar.gz
rust-74b2d9e19b2784aed009bd34aaeed43248944aca.zip
rt: Remove last use of C++ exchange alloc
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/time.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libextra/time.rs b/src/libextra/time.rs
index 257d941e4af..6119170f130 100644
--- a/src/libextra/time.rs
+++ b/src/libextra/time.rs
@@ -121,6 +121,9 @@ pub struct Tm {
 }
 
 pub fn empty_tm() -> Tm {
+    // 64 is the max size of the timezone buffer allocated on windows
+    // in rust_localtime. In glibc the max timezone size is supposedly 3.
+    let zone = str::with_capacity(64);
     Tm {
         tm_sec: 0_i32,
         tm_min: 0_i32,
@@ -132,7 +135,7 @@ pub fn empty_tm() -> Tm {
         tm_yday: 0_i32,
         tm_isdst: 0_i32,
         tm_gmtoff: 0_i32,
-        tm_zone: ~"",
+        tm_zone: zone,
         tm_nsec: 0_i32,
     }
 }