Search completed in 0.84 seconds.
10 results for "NS_Free":
NS_Free
MozillaTechXPCOMReferenceCore functionsNS Free
#include "nsxpcom.h" void ns_free( void* aptr ); parameters aptr [in] a pointer to the block of memory to free.
Mozilla internal string guide
MozillaTechXPCOMGuideInternal strings
outside of libxul you should use ns_free to deallocate the result when you no longer need it, inside libxul free() is preferred..
... ns_free(val); return ns_error_failure; } ...
... ns_free(val); } with getter_copies() you never have to worry about this.
XPIDL
MozillaTechXPIDL
for buffers, the callee allocates the buffer with ns_alloc, and the caller frees the buffer with ns_free.
...buffers must be deallocated with ns_free, and interface pointers must be release'd.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
ArchiveAdd-onsMigrating from Internal Linkage to Frozen Linkage
" + #include "nscrtglue.h" const prunichar str[] = {'f','o','o','\0'}; - pruint32 len = nscrt::strlen(str); + pruint32 len = ns_strlen(str); - #include "nscrt.h" + #include "nsmemory.h" + #include "nscrtglue.h" prunichar* anotherstr = (prunichar*) ns_alloc(100 * sizeof(prunichar)); - prunichar *str = nscrt::strdup(anotherstr); - nscrt::free(str); + prunichar *str = ns_strdup(anotherstr); + ns_free(str); linking for information about the correct libraries to link to when using frozen linkage, see xpcom glue.
Choosing the right memory allocator
MozillaChoosing the right memory allocator
ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null.
Index
MozillaTechXPCOMIndex
128 ns_free functions, functions:frozen, xpcom, xpcom api reference frees a block of memory using the xpcom memory manager.
NS_Alloc
MozillaTechXPCOMReferenceCore functionsNS Alloc
see also ns_free, nsimemory, ns_getmemorymanager ...
NS_GetMemoryManager
MozillaTechXPCOMReferenceCore functionsNS GetMemoryManager
any code, intended to be used exclusively with mozilla 1.8 and above, may use ns_alloc, ns_realloc, and ns_free instead to access the xpcom memory manager's methods.
Core XPCOM functions
MozillaTechXPCOMReferenceCore functions
ns_allocinfallibly allocates a block of memory using the xpcom memory manager.ns_freefrees a block of memory using the xpcom memory manager.ns_getcomponentmanagerthe ns_getcomponentmanager function returns a reference to the xpcom component manager.ns_getcomponentregistrarthe ns_getcomponentregistrar function returns a reference to the xpcom component registrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 func...
nsIProperties
MozillaTechXPCOMReferenceInterfacensIProperties
nsmemory.h defines the macro ns_free_xpcom_allocated_pointer_array, which can be used to free akeys when it is no longer needed.