Glib::ustring
- From: Micha Renner <Micha Renner t-online de>
- To: gtkmm-list gnome org
- Subject: Glib::ustring
- Date: Tue, 29 Apr 2008 10:26:03 +0200
Hallo,
I have a question according to ustring in comparison with std::string
(see below)
int main()
{
Glib::ustring s = ("Test");
// No additional heap
std::cout << s.c_str() << std::endl;
// additional heap: (3 x malloc means 3 calls of malloc etc. )
// Windows: 3 x malloc, 1 x realloc, 1 x free, 6 x calloc
// Linux: 4 x malloc, 1 x realloc, 2 x free, 6 x calloc
std::cout << s << std::endl;
std::string t = ("Test");
// No additional heap
std::cout << t << std::endl;
std::cout << "End" << std::endl;
return 0;
}
In comparison to std:string it seems that ustring has to do a lot of
more work.
It occurs to me that there might be a memory leak, because the # of
free-calls appears to be low.
Greetings
Michael
// glibmm (Windows-Version) 2.12.10
// Linux 2.16.0-1 (Ubuntu 8/04)
// MSVC: Version 14.0
// gcc: 4.2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]