This is excessive allocation I think?
For example
* 1 dchar => 8 wchar (2 is enough)
* 1 dchar => 8 char (4 is enough)
* 1 wchar => 4 char (3 is enough)

Unsure what the correct formula is, off the top of my head.