Jo Ueyama wrote:
Hi All,
    Is there any CoTaskMemAlloc/CoTaskMemFree functions for XPCOM? I am
porting some code from MSCOM to XPCOM.
    If there is *not* any similar function for XPCOM, should I just go
for gcc malloc/free functions?
    Thanks a lot in advance!

Cheers,
-Jo

See nsIMemory.idl and NS_GetMemoryManager(). Stay away from malloc/free if you are going to to be passing memory around (and may get deleted by another part of the system). Although, XPCOM implementation of nsIMemory does use malloc/free under the hood, other parts of the system may not.

Regards,
--
Doug Turner
[EMAIL PROTECTED]


Reply via email to