--- rxvt-unicode/src/rxvtutil.h 2006/01/17 16:06:48 1.18 +++ rxvt-unicode/src/rxvtutil.h 2006/01/25 00:42:21 1.20 @@ -1,6 +1,7 @@ #ifndef RXVT_UTIL_H #define RXVT_UTIL_H +#include #include #define PP_CONCAT_(a, b) a ## b @@ -393,9 +394,19 @@ ~stringvec () { for (char **c = begin (); c != end (); c++) - delete [] *c; + free (*c); } }; +// return a very temporary (and never deallocated) buffer. keep small. +void *rxvt_temp_buf (int len); + +template +inline T * +rxvt_temp_buf (int len) +{ + return (T *)rxvt_temp_buf (len * sizeof (T)); +} + #endif