Q
Quentin Yuan
I always consider that the constant character strings of which
literal value are the same lay out at the same logic address, in
another words, every constant character string have only one copy in
the program. My view base on that if it doesn't that, you lose the
memory of the string that you have used except store the address in a
pointer, this is a form of memory leak although it doesn't really eat
the memory as the general memory leak. The x86 machine always support
my view
But recently someone told me that the addresses of the same character
strings are not the same in SunOS, so it seems that how to lay out the
constant strings is complier dependent. If it's true, I wonder the
reason why my view is wrong? Both informations and links are
appreciated. Thanks to all!
Best Regards
literal value are the same lay out at the same logic address, in
another words, every constant character string have only one copy in
the program. My view base on that if it doesn't that, you lose the
memory of the string that you have used except store the address in a
pointer, this is a form of memory leak although it doesn't really eat
the memory as the general memory leak. The x86 machine always support
my view
But recently someone told me that the addresses of the same character
strings are not the same in SunOS, so it seems that how to lay out the
constant strings is complier dependent. If it's true, I wonder the
reason why my view is wrong? Both informations and links are
appreciated. Thanks to all!
Best Regards