Brodie Thiesfield wrote:

Hi,

I've noticed a few places in mozilla code where strings are returned via xpcom interfaces using NSPR malloc or nsCRT instead of nsMemory. e.g. <http://lxr.mozilla.org/seamonkey/source/mailnews/imap/src/nsImapUrl.cpp#346>


I understood from the XPIDL document at <http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/best-practices.html#string-passing> that all memory needs to be allocated using nsMemory.


Is this only the case when the interface is scriptable and used by scripts, and at other times the allocator doesn't matter? Obviously mozilla is working fine with the allocator as it is and it probably isn't necessary to change it, but what is the policy on this?

Brodie

My understanding is exactly that. You only need to use nsMemory when the data is going to be used and potentially freed in a script.


Justin
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to