Re: Glib::ustring



Well, that must be 'coz std::string does not handle UTF at all, trying doing the same test with std::wstring? You will see how things in the std world change.
Micha Renner wrote:
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


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]