--- rxvt-unicode/src/rxvtutil.C 2004/08/15 00:37:04 1.1 +++ rxvt-unicode/src/rxvtutil.C 2006/01/25 00:42:21 1.3 @@ -6,6 +6,8 @@ class byteorder byteorder; +unsigned int byteorder::e; + byteorder::byteorder () { union { @@ -21,5 +23,35 @@ e = w.u; } +void * +zero_initialized::operator new (size_t s) +{ + void *p = malloc (s); + + memset (p, 0, s); + return p; +} + +void +zero_initialized::operator delete (void *p, size_t s) +{ + free (p); +} + +static void *temp_buf; +static uint32_t temp_len; + +void * +rxvt_temp_buf (int len) +{ + if (len > temp_len) + { + free (temp_buf); + temp_buf = malloc (len); + temp_len = len; + } + + return temp_buf; +}