diff --git a/mozilla/caps/idl/nsIPrincipal.idl b/mozilla/caps/idl/nsIPrincipal.idl index fa9ed78b7bd..50647149c63 100644 --- a/mozilla/caps/idl/nsIPrincipal.idl +++ b/mozilla/caps/idl/nsIPrincipal.idl @@ -62,13 +62,13 @@ interface nsIPrincipal : nsISupports { void SetCanEnableCapability(in string capability, in short canEnable); - boolean IsCapabilityEnabled(in string capability, in voidStar annotation); + boolean IsCapabilityEnabled(in string capability, in voidPtr annotation); - void EnableCapability(in string capability, inout voidStar annotation); + void EnableCapability(in string capability, inout voidPtr annotation); - void RevertCapability(in string capability, inout voidStar annotation); + void RevertCapability(in string capability, inout voidPtr annotation); - void DisableCapability(in string capability, inout voidStar annotation); + void DisableCapability(in string capability, inout voidPtr annotation); }; diff --git a/mozilla/caps/idl/nsIScriptSecurityManager.idl b/mozilla/caps/idl/nsIScriptSecurityManager.idl index 1d0caad7381..ba7eed09980 100644 --- a/mozilla/caps/idl/nsIScriptSecurityManager.idl +++ b/mozilla/caps/idl/nsIScriptSecurityManager.idl @@ -69,7 +69,7 @@ interface nsIScriptSecurityManager : nsISupports * @param prop The ordinal of the property being accessed (see nsDOMPropEnums.h) * @param isWrite True if write access is being attempted */ - void CheckScriptAccess(in JSContextPtr cx, in voidStar obj, + void CheckScriptAccess(in JSContextPtr cx, in voidPtr obj, in long prop, in boolean isWrite); /** @@ -107,7 +107,7 @@ interface nsIScriptSecurityManager : nsISupports * Return true if the given JavaScript function object was compiled with * a principal that is allowed to execute scripts. */ - boolean CanExecuteFunction(in voidStar jsFunction); + boolean CanExecuteFunction(in voidPtr jsFunction); ///////////////// Capabilities ///////////////////// diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 10ddf5e3c20..3d993869471 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -727,7 +727,7 @@ NS_IMETHODIMP nsChromeRegistry::GetStyleSheets(nsIURI *aChromeURL, nsISupportsAr url->GetSpec(&str); LoadStyleSheet(getter_AddRefs(sheet), str); (*aResult)->AppendElement(sheet); - nsAllocator::Free(str); + nsMemory::Free(str); } sheets->HasMoreElements(&hasMore); } @@ -763,7 +763,7 @@ NS_IMETHODIMP nsChromeRegistry::GetDynamicInfo(nsIURI *aChromeURL, PRBool aIsOve NS_ERROR("Unable to retrieve the resource corresponding to the chrome skin or content."); return rv; } - nsAllocator::Free(lookup); + nsMemory::Free(lookup); nsCOMPtr installArcs; nsCOMPtr profileArcs; @@ -1227,7 +1227,7 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS } arcs->HasMoreElements(&moreElements); } - nsAllocator::Free(value); + nsMemory::Free(value); return NS_OK; } diff --git a/mozilla/content/base/public/nsContentPolicyUtils.h b/mozilla/content/base/public/nsContentPolicyUtils.h index 99b5d71456d..3ef2c78ec07 100644 --- a/mozilla/content/base/public/nsContentPolicyUtils.h +++ b/mozilla/content/base/public/nsContentPolicyUtils.h @@ -25,7 +25,7 @@ #include "nsString.h" #include "nsIContentPolicy.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIServiceManager.h" #ifndef __nsContentPolicyUtils_h__ diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index b3eefe728d3..bacdf390654 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -3508,7 +3508,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec, // Get a document encoder instance: nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/content/html/content/src/nsHTMLEmbedElement.cpp b/mozilla/content/html/content/src/nsHTMLEmbedElement.cpp index 3f9ad8d16ef..57e6faaf331 100644 --- a/mozilla/content/html/content/src/nsHTMLEmbedElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLEmbedElement.cpp @@ -37,7 +37,7 @@ #include "nsLayoutAtoms.h" #include "nsObjectFrame.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "xptinfo.h" #include "nsIInterfaceInfoManager.h" #include "nsIPluginInstance.h" @@ -337,7 +337,7 @@ nsHTMLEmbedElement::GetProperty(JSContext *aContext, JSObject *aObj, jsval aID, retval = PR_TRUE; } } - nsAllocator::Free(iid); + nsMemory::Free(iid); return retval; } } diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 0c1c4f1b721..3b67028f8c2 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -4050,7 +4050,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) uri = baseURI; } else { rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI); - nsAllocator::Free(uriAttrib); + nsMemory::Free(uriAttrib); } if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index e3892c2582e..3031d225990 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -2007,7 +2007,7 @@ CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *aRule) sel->mAttr->ToString(str); char * chars = str.ToNewCString(); fprintf(stderr, "[%s@%p]", chars, this); - nsAllocator::Free(chars); + nsMemory::Free(chars); #endif AtomKey key(sel->mAttr); mInner->mRelevantAttributes.Put(&key, sel->mAttr); diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index bb7b5610c44..83b4aa72138 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -819,7 +819,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) &myFunc); } for (PRUint32 l = 0; l < argCount; l++) { - nsAllocator::Free(args[l]); + nsMemory::Free(args[l]); } } else if (tagName.get() == kPropertyAtom) { @@ -1328,7 +1328,7 @@ nsXBLBinding::BuildInsertionTable() token = nsCRT::strtok( newStr, ", ", &newStr ); } - nsAllocator::Free(str); + nsMemory::Free(str); } } } @@ -1455,7 +1455,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) token = nsCRT::strtok( newStr, ", ", &newStr ); } - nsAllocator::Free(str); + nsMemory::Free(str); } // Recur into our children. diff --git a/mozilla/content/xbl/src/nsXBLService.cpp b/mozilla/content/xbl/src/nsXBLService.cpp index 569b5b6a3df..3fd791b38ab 100644 --- a/mozilla/content/xbl/src/nsXBLService.cpp +++ b/mozilla/content/xbl/src/nsXBLService.cpp @@ -178,7 +178,7 @@ nsXBLService::nsXBLService(void) static PRBool PR_CALLBACK DeleteClasses(nsHashKey* aKey, void* aValue, void* closure) { JSClass* c = (JSClass*)aValue; - nsAllocator::Free(c->name); + nsMemory::Free(c->name); delete c; return PR_TRUE; } diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 2cce39a3a55..f5a36e9b11d 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2577,9 +2577,9 @@ NS_IMETHODIMP nsDocShell::KeywordURIFixup(const PRUnichar* aStringURI, { keywordSpec.Append(escapedUTF8Spec); NS_NewURI(aURI, keywordSpec.GetBuffer(), nsnull); - nsAllocator::Free(escapedUTF8Spec); + nsMemory::Free(escapedUTF8Spec); } // escapedUTF8Spec - nsAllocator::Free(utf8Spec); + nsMemory::Free(utf8Spec); } // utf8Spec } // keyword } // FindChar @@ -2948,7 +2948,7 @@ void nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, loadType aLoadType uri = baseURI; } else { NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI); - nsAllocator::Free(uriAttrib); + nsMemory::Free(uriAttrib); } RefreshURI (uri, millis, PR_FALSE); diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index fdfd41daf3d..6e5139817c2 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1224,7 +1224,7 @@ NS_IMETHODIMP GlobalWindowImpl::Prompt(JSContext* cx, jsval* argv, initial.GetUnicode(), &uniResult, &b); aReturn = uniResult; if(uniResult) - nsAllocator::Free(uniResult); + nsMemory::Free(uniResult); if(NS_FAILED(ret) || !b) { // XXX Need to check return value and return null if the @@ -1767,7 +1767,7 @@ NS_IMETHODIMP GlobalWindowImpl::Escape(const nsString& aStr, nsString& aReturn) return result; // Allocate a buffer of the maximum length - char* dest = (char*)nsAllocator::Alloc(maxByteLen+1); + char* dest = (char*)nsMemory::Alloc(maxByteLen+1); PRInt32 destLen2, destLen = maxByteLen; if(!dest) return NS_ERROR_OUT_OF_MEMORY; @@ -1776,7 +1776,7 @@ NS_IMETHODIMP GlobalWindowImpl::Escape(const nsString& aStr, nsString& aReturn) result = encoder->Convert(src, &srcLen, dest, &destLen); if(NS_FAILED(result)) { - nsAllocator::Free(dest); + nsMemory::Free(dest); return result; } @@ -1789,8 +1789,8 @@ NS_IMETHODIMP GlobalWindowImpl::Escape(const nsString& aStr, nsString& aReturn) char* outBuf = nsEscape(dest, nsEscapeMask(url_XAlphas | url_XPAlphas | url_Path)); aReturn.AssignWithConversion(outBuf); - nsAllocator::Free(outBuf); - nsAllocator::Free(dest); + nsMemory::Free(outBuf); + nsMemory::Free(dest); return result; } @@ -1840,30 +1840,30 @@ NS_IMETHODIMP GlobalWindowImpl::Unescape(const nsString& aStr, nsString& aReturn result = decoder->GetMaxLength(src, srcLen, &maxLength); if(NS_FAILED(result)) { - nsAllocator::Free(src); + nsMemory::Free(src); return result; } // Allocate a buffer of the maximum length - PRUnichar* dest = (PRUnichar*)nsAllocator::Alloc(sizeof(PRUnichar)*maxLength); + PRUnichar* dest = (PRUnichar*)nsMemory::Alloc(sizeof(PRUnichar)*maxLength); PRInt32 destLen = maxLength; if(!dest) { - nsAllocator::Free(src); + nsMemory::Free(src); return NS_ERROR_OUT_OF_MEMORY; } // Convert from character set to unicode result = decoder->Convert(src, &srcLen, dest, &destLen); - nsAllocator::Free(src); + nsMemory::Free(src); if(NS_FAILED(result)) { - nsAllocator::Free(dest); + nsMemory::Free(dest); return result; } aReturn.Assign(dest, destLen); - nsAllocator::Free(dest); + nsMemory::Free(dest); return NS_OK; } diff --git a/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index de6442ba33a..97056a31c42 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/dom/src/base/nsJSEnvironment.cpp @@ -126,14 +126,14 @@ NS_ScriptErrorReporter(JSContext *cx, rv = errorObject->Init(report->ucmessage, newFileUni, report->uclinebuf, report->lineno, column, report->flags, category); - nsAllocator::Free((void *)newFileUni); + nsMemory::Free((void *)newFileUni); } else if (message) { nsAutoString messageUni; messageUni.AssignWithConversion(message); const PRUnichar *newMessageUni = messageUni.ToNewUnicode(); rv = errorObject->Init(newMessageUni, nsnull, nsnull, 0, 0, 0, category); - nsAllocator::Free((void *)newMessageUni); + nsMemory::Free((void *)newMessageUni); } if (NS_SUCCEEDED(rv)) @@ -161,7 +161,7 @@ NS_ScriptErrorReporter(JSContext *cx, char *errorStr = error.ToNewCString(); if (errorStr) { fprintf(stderr, "%s\n", errorStr); - nsAllocator::Free(errorStr); + nsMemory::Free(errorStr); } #ifdef PR_LOGGING diff --git a/mozilla/editor/base/CreateElementTxn.cpp b/mozilla/editor/base/CreateElementTxn.cpp index e593c620bd5..386498e8b9b 100644 --- a/mozilla/editor/base/CreateElementTxn.cpp +++ b/mozilla/editor/base/CreateElementTxn.cpp @@ -76,7 +76,7 @@ NS_IMETHODIMP CreateElementTxn::Do(void) char* nodename = mTag.ToNewCString(); printf("Do Create Element parent = %p <%s>, offset = %d\n", mParent.get(), nodename, mOffsetInParent); - nsAllocator::Free(nodename); + nsMemory::Free(nodename); } NS_ASSERTION(mEditor && mParent, "bad state"); diff --git a/mozilla/editor/base/InsertElementTxn.cpp b/mozilla/editor/base/InsertElementTxn.cpp index 4c3806d624c..010153516f7 100644 --- a/mozilla/editor/base/InsertElementTxn.cpp +++ b/mozilla/editor/base/InsertElementTxn.cpp @@ -74,7 +74,7 @@ NS_IMETHODIMP InsertElementTxn::Do(void) printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n", this, nodeAsContent.get(), nodename, parentAsContent.get(), mOffset); - nsAllocator::Free(nodename); + nsMemory::Free(nodename); } if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED; diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index cb0b20a9f82..e738af3cd42 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -2779,7 +2779,7 @@ void nsEditorShell::GetBundleString(const nsString& name, nsString &outString) else outString.SetLength(0); - nsAllocator::Free(ptrv); + nsMemory::Free(ptrv); } else { @@ -4439,7 +4439,7 @@ nsEditorShell::GetDictionaryList(PRUnichar ***aDictionaryList, PRUint32 *aCount) // If there are no dictionaries, return an array containing // one element and a count of one. - tmpPtr = (PRUnichar **)nsAllocator::Alloc(sizeof(PRUnichar *)); + tmpPtr = (PRUnichar **)nsMemory::Alloc(sizeof(PRUnichar *)); if (!tmpPtr) return NS_ERROR_OUT_OF_MEMORY; @@ -4451,7 +4451,7 @@ nsEditorShell::GetDictionaryList(PRUnichar ***aDictionaryList, PRUint32 *aCount) return NS_OK; } - tmpPtr = (PRUnichar **)nsAllocator::Alloc(sizeof(PRUnichar *) * dictList.Count()); + tmpPtr = (PRUnichar **)nsMemory::Alloc(sizeof(PRUnichar *) * dictList.Count()); if (!tmpPtr) return NS_ERROR_OUT_OF_MEMORY; @@ -4744,7 +4744,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* aChanne mCantEditReason = eCantEditMimeType; } - nsAllocator::Free(contentType); + nsMemory::Free(contentType); } } diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index ba56888cf4f..a9f0960526d 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -5212,7 +5212,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString, nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); @@ -5292,7 +5292,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream, } nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index cb0b20a9f82..e738af3cd42 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -2779,7 +2779,7 @@ void nsEditorShell::GetBundleString(const nsString& name, nsString &outString) else outString.SetLength(0); - nsAllocator::Free(ptrv); + nsMemory::Free(ptrv); } else { @@ -4439,7 +4439,7 @@ nsEditorShell::GetDictionaryList(PRUnichar ***aDictionaryList, PRUint32 *aCount) // If there are no dictionaries, return an array containing // one element and a count of one. - tmpPtr = (PRUnichar **)nsAllocator::Alloc(sizeof(PRUnichar *)); + tmpPtr = (PRUnichar **)nsMemory::Alloc(sizeof(PRUnichar *)); if (!tmpPtr) return NS_ERROR_OUT_OF_MEMORY; @@ -4451,7 +4451,7 @@ nsEditorShell::GetDictionaryList(PRUnichar ***aDictionaryList, PRUint32 *aCount) return NS_OK; } - tmpPtr = (PRUnichar **)nsAllocator::Alloc(sizeof(PRUnichar *) * dictList.Count()); + tmpPtr = (PRUnichar **)nsMemory::Alloc(sizeof(PRUnichar *) * dictList.Count()); if (!tmpPtr) return NS_ERROR_OUT_OF_MEMORY; @@ -4744,7 +4744,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* aChanne mCantEditReason = eCantEditMimeType; } - nsAllocator::Free(contentType); + nsMemory::Free(contentType); } } diff --git a/mozilla/editor/libeditor/base/CreateElementTxn.cpp b/mozilla/editor/libeditor/base/CreateElementTxn.cpp index e593c620bd5..386498e8b9b 100644 --- a/mozilla/editor/libeditor/base/CreateElementTxn.cpp +++ b/mozilla/editor/libeditor/base/CreateElementTxn.cpp @@ -76,7 +76,7 @@ NS_IMETHODIMP CreateElementTxn::Do(void) char* nodename = mTag.ToNewCString(); printf("Do Create Element parent = %p <%s>, offset = %d\n", mParent.get(), nodename, mOffsetInParent); - nsAllocator::Free(nodename); + nsMemory::Free(nodename); } NS_ASSERTION(mEditor && mParent, "bad state"); diff --git a/mozilla/editor/libeditor/base/InsertElementTxn.cpp b/mozilla/editor/libeditor/base/InsertElementTxn.cpp index 4c3806d624c..010153516f7 100644 --- a/mozilla/editor/libeditor/base/InsertElementTxn.cpp +++ b/mozilla/editor/libeditor/base/InsertElementTxn.cpp @@ -74,7 +74,7 @@ NS_IMETHODIMP InsertElementTxn::Do(void) printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n", this, nodeAsContent.get(), nodename, parentAsContent.get(), mOffset); - nsAllocator::Free(nodename); + nsMemory::Free(nodename); } if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED; diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index ba56888cf4f..a9f0960526d 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -5212,7 +5212,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString, nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); @@ -5292,7 +5292,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream, } nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/embedding/browser/gtk/src/GtkMozEmbedStream.cpp b/mozilla/embedding/browser/gtk/src/GtkMozEmbedStream.cpp index 8cc94cefada..2e555ae8ecb 100644 --- a/mozilla/embedding/browser/gtk/src/GtkMozEmbedStream.cpp +++ b/mozilla/embedding/browser/gtk/src/GtkMozEmbedStream.cpp @@ -20,7 +20,7 @@ */ #include "GtkMozEmbedStream.h" -#include "nsIAllocator.h" +#include "nsMemory.h" // nsIInputStream interface @@ -42,7 +42,7 @@ GtkMozEmbedStream::GtkMozEmbedStream() GtkMozEmbedStream::~GtkMozEmbedStream() { if (mBuffer) - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); } NS_IMETHODIMP GtkMozEmbedStream::Available(PRUint32 *_retval) @@ -94,7 +94,7 @@ NS_IMETHODIMP GtkMozEmbedStream::Read(char * aBuf, PRUint32 aCount, PRUint32 *_r NS_IMETHODIMP GtkMozEmbedStream::Close(void) { if (mBuffer) - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mLength = 0; mBufLen = 0; return NS_OK; @@ -109,7 +109,7 @@ NS_METHOD GtkMozEmbedStream::Append(const char *aData, PRUint32 aLen) // first time if (!mBuffer) { - mBuffer = (char *)nsAllocator::Alloc(mLength); + mBuffer = (char *)nsMemory::Alloc(mLength); mBufLen = mLength; if (!mBuffer) { @@ -126,12 +126,12 @@ NS_METHOD GtkMozEmbedStream::Append(const char *aData, PRUint32 aLen) if (mLength > mBufLen) { char *newBuffer; - newBuffer = (char *)nsAllocator::Realloc(mBuffer, mLength); + newBuffer = (char *)nsMemory::Realloc(mBuffer, mLength); if (!newBuffer) { mLength = 0; mBufLen = 0; - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBuffer = NULL; return NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/embedding/browser/powerplant/source/CThrobber.cpp b/mozilla/embedding/browser/powerplant/source/CThrobber.cpp index 3c144faf87f..2caad46bcdb 100644 --- a/mozilla/embedding/browser/powerplant/source/CThrobber.cpp +++ b/mozilla/embedding/browser/powerplant/source/CThrobber.cpp @@ -298,7 +298,7 @@ NS_METHOD CThrobber::LoadImages(const nsString& aFileNameMask, PRInt32 aNumImage } if (nsnull != mask) - nsAllocator::Free(mask); + nsMemory::Free(mask); mWidget->Invalidate(PR_TRUE); diff --git a/mozilla/extensions/cookie/nsCookieHTTPNotify.cpp b/mozilla/extensions/cookie/nsCookieHTTPNotify.cpp index 7dadfe6fc5b..a00785b8e85 100644 --- a/mozilla/extensions/cookie/nsCookieHTTPNotify.cpp +++ b/mozilla/extensions/cookie/nsCookieHTTPNotify.cpp @@ -29,7 +29,7 @@ #include "nsCRT.h" #include "nsXPIDLString.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsINetModuleMgr.h" #include "nsILoadGroup.h" #include "nsICategoryManager.h" @@ -67,7 +67,7 @@ NS_METHOD nsCookieHTTPNotify::RegisterProc(nsIComponentManager *aCompMgr, nsXPIDLCString prevEntry; rv = catman->AddCategoryEntry(NS_HTTP_STARTUP_CATEGORY, "Http Cookie Notify", cidString, PR_TRUE, PR_TRUE, getter_Copies(prevEntry)); - nsAllocator::Free(cidString); + nsMemory::Free(cidString); return NS_OK; @@ -86,7 +86,7 @@ NS_METHOD nsCookieHTTPNotify::UnregisterProc(nsIComponentManager *aCompMgr, nsXPIDLCString prevEntry; rv = catman->DeleteCategoryEntry("http-startup-category", cidString, PR_TRUE, getter_Copies(prevEntry)); - nsAllocator::Free(cidString); + nsMemory::Free(cidString); // Return value is not used from this function. return NS_OK; @@ -192,7 +192,7 @@ nsCookieHTTPNotify::ModifyRequest(nsISupports *aContext) // only set a cookie header if we have a value to send if (*cookieRaw) rv = pHTTPConnection->SetRequestHeader(mCookieHeader, cookieRaw); - nsAllocator::Free((void *)cookieRaw); + nsMemory::Free((void *)cookieRaw); return rv; } diff --git a/mozilla/extensions/irc/libbs/bsXPCConnection.cpp b/mozilla/extensions/irc/libbs/bsXPCConnection.cpp index 5e85ab5cec0..3a119aaecd1 100644 --- a/mozilla/extensions/irc/libbs/bsXPCConnection.cpp +++ b/mozilla/extensions/irc/libbs/bsXPCConnection.cpp @@ -26,7 +26,7 @@ #include "plstr.h" #include "nscore.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "bsIConnection.h" #include "bsapi.h" @@ -281,12 +281,12 @@ bsConnection::ReadData(PRUint32 timeout, char **aData) else if (c == 0) { - *aData = (char*) nsAllocator::Alloc(1); + *aData = (char*) nsMemory::Alloc(1); **aData = '\00'; } else { - *aData = (char*) nsAllocator::Alloc(PL_strlen(data) + 1); + *aData = (char*) nsMemory::Alloc(PL_strlen(data) + 1); if (! *aData) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/extensions/psm-glue/public/nsIPSMSocketInfo.idl b/mozilla/extensions/psm-glue/public/nsIPSMSocketInfo.idl index 7219bd85767..a3bce202f29 100644 --- a/mozilla/extensions/psm-glue/public/nsIPSMSocketInfo.idl +++ b/mozilla/extensions/psm-glue/public/nsIPSMSocketInfo.idl @@ -45,6 +45,6 @@ interface nsIPSMSocketInfo : nsISupports { readonly attribute cmSocketStar socketPtr; readonly attribute nsFileDescStar fileDescPtr; - void getPickledStatus(out charStar pickledStatus); + void getPickledStatus(out charPtr pickledStatus); }; diff --git a/mozilla/extensions/psm-glue/src/nsCrypto.cpp b/mozilla/extensions/psm-glue/src/nsCrypto.cpp index 6683e2e4d2e..06a8c499c3a 100644 --- a/mozilla/extensions/psm-glue/src/nsCrypto.cpp +++ b/mozilla/extensions/psm-glue/src/nsCrypto.cpp @@ -21,7 +21,7 @@ */ #include "nsCrypto.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsCRT.h" #include "prprf.h" #include "prmem.h" diff --git a/mozilla/extensions/psm-glue/src/nsFSDR.cpp b/mozilla/extensions/psm-glue/src/nsFSDR.cpp index 4a0f8cf2a4f..177f83ac2f2 100644 --- a/mozilla/extensions/psm-glue/src/nsFSDR.cpp +++ b/mozilla/extensions/psm-glue/src/nsFSDR.cpp @@ -23,7 +23,7 @@ #include "stdlib.h" #include "plstr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIServiceManager.h" #include "nsISecretDecoderRing.h" @@ -826,7 +826,7 @@ Encrypt(unsigned char * data, PRInt32 dataLen, unsigned char * *result, PRInt32 data, dataLen, result, &cLen); if (status != CMTSuccess) { rv = NS_ERROR_FAILURE; goto loser; } /* XXX */ - /* Copy returned data to nsAllocator buffer ? */ + /* Copy returned data to nsMemory buffer ? */ *_retval = cLen; loser: @@ -859,7 +859,7 @@ Decrypt(unsigned char * data, PRInt32 dataLen, unsigned char * *result, PRInt32 status = CMT_SDRDecrypt(control, (void *)0, data, dataLen, result, &len); if (status != CMTSuccess) { rv = NS_ERROR_FAILURE; goto loser; } /* Promote? */ - /* Copy returned data to nsAllocator buffer ? */ + /* Copy returned data to nsMemory buffer ? */ *_retval = len; loser: @@ -908,7 +908,7 @@ EncryptString(const char *text, char **_retval) rv = encode(encrypted, eLen, _retval); loser: - if (encrypted) nsAllocator::Free(encrypted); + if (encrypted) nsMemory::Free(encrypted); return rv; } @@ -958,7 +958,7 @@ DecryptString(const char *crypt, char **_retval) if (rv != NS_OK) goto loser; // Convert to NUL-terminated string - r = (char *)nsAllocator::Alloc(decryptedLen+1); + r = (char *)nsMemory::Alloc(decryptedLen+1); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, decrypted, decryptedLen); @@ -968,9 +968,9 @@ DecryptString(const char *crypt, char **_retval) r = 0; loser: - if (r) nsAllocator::Free(r); - if (decrypted) nsAllocator::Free(decrypted); - if (decoded) nsAllocator::Free(decoded); + if (r) nsMemory::Free(r); + if (decrypted) nsMemory::Free(decrypted); + if (decoded) nsMemory::Free(decoded); return rv; } @@ -1036,7 +1036,7 @@ encode(const unsigned char *data, PRInt32 dataLen, char **_retval) char *r = 0; // Allocate space for encoded string (with NUL) - r = (char *)nsAllocator::Alloc(dataLen+1); + r = (char *)nsMemory::Alloc(dataLen+1); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, data, dataLen); @@ -1046,7 +1046,7 @@ encode(const unsigned char *data, PRInt32 dataLen, char **_retval) r = 0; loser: - if (r) nsAllocator::Free(r); + if (r) nsMemory::Free(r); return rv; } @@ -1060,7 +1060,7 @@ decode(const char *data, unsigned char **result, PRInt32 * _retval) // Allocate space for decoded string (missing NUL) rLen = PL_strlen(data); - r = (unsigned char *)nsAllocator::Alloc(rLen); + r = (unsigned char *)nsMemory::Alloc(rLen); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, data, rLen); @@ -1070,7 +1070,7 @@ decode(const char *data, unsigned char **result, PRInt32 * _retval) *_retval = rLen; loser: - if (r) nsAllocator::Free(r); + if (r) nsMemory::Free(r); return rv; } diff --git a/mozilla/extensions/psm-glue/src/nsPSMComponent.cpp b/mozilla/extensions/psm-glue/src/nsPSMComponent.cpp index 34c97d976b6..829a8a10147 100644 --- a/mozilla/extensions/psm-glue/src/nsPSMComponent.cpp +++ b/mozilla/extensions/psm-glue/src/nsPSMComponent.cpp @@ -572,7 +572,7 @@ CertDownloader::CertDownloader(PRInt32 type) CertDownloader::~CertDownloader() { if (mByteData) - nsAllocator::Free(mByteData); + nsMemory::Free(mByteData); } NS_IMPL_ISUPPORTS(CertDownloader,NS_GET_IID(nsIStreamListener)); @@ -586,7 +586,7 @@ CertDownloader::OnStartRequest(nsIChannel* channel, nsISupports* context) return NS_ERROR_FAILURE; mBufferOffset = 0; - mByteData = (char*) nsAllocator::Alloc(mContentLength); + mByteData = (char*) nsMemory::Alloc(mContentLength); if (!mByteData) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp b/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp index e2e002bfede..37f0bf21fbe 100644 --- a/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp +++ b/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp @@ -325,7 +325,7 @@ char * PromptUserCallback(void *arg, char *prompt, int isPasswd) void ApplicationFreeCallback(char *userInput) { - nsAllocator::Free(userInput); + nsMemory::Free(userInput); } char * FilePathPromptCallback(void *arg, char *prompt, char *fileRegEx, CMUint32 shouldFileExist) diff --git a/mozilla/extensions/psm-glue/src/nsSDR.cpp b/mozilla/extensions/psm-glue/src/nsSDR.cpp index d57cf2b1cae..b6cdd79ec0c 100644 --- a/mozilla/extensions/psm-glue/src/nsSDR.cpp +++ b/mozilla/extensions/psm-glue/src/nsSDR.cpp @@ -23,7 +23,7 @@ #include "stdlib.h" #include "plstr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIServiceManager.h" #include "plbase64.h" @@ -93,7 +93,7 @@ Encrypt(unsigned char * data, PRInt32 dataLen, unsigned char * *result, PRInt32 data, dataLen, result, &cLen); if (status != CMTSuccess) { rv = NS_ERROR_FAILURE; goto loser; } /* XXX */ - /* Copy returned data to nsAllocator buffer ? */ + /* Copy returned data to nsMemory buffer ? */ *_retval = cLen; loser: @@ -126,7 +126,7 @@ Decrypt(unsigned char * data, PRInt32 dataLen, unsigned char * *result, PRInt32 status = CMT_SDRDecrypt(control, (void *)0, data, dataLen, result, &len); if (status != CMTSuccess) { rv = NS_ERROR_FAILURE; goto loser; } /* Promote? */ - /* Copy returned data to nsAllocator buffer ? */ + /* Copy returned data to nsMemory buffer ? */ *_retval = len; loser: @@ -152,7 +152,7 @@ EncryptString(const char *text, char **_retval) rv = encode(encrypted, eLen, _retval); loser: - if (encrypted) nsAllocator::Free(encrypted); + if (encrypted) nsMemory::Free(encrypted); return rv; } @@ -180,7 +180,7 @@ DecryptString(const char *crypt, char **_retval) if (rv != NS_OK) goto loser; // Convert to NUL-terminated string - r = (char *)nsAllocator::Alloc(decryptedLen+1); + r = (char *)nsMemory::Alloc(decryptedLen+1); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, decrypted, decryptedLen); @@ -190,9 +190,9 @@ DecryptString(const char *crypt, char **_retval) r = 0; loser: - if (r) nsAllocator::Free(r); - if (decrypted) nsAllocator::Free(decrypted); - if (decoded) nsAllocator::Free(decoded); + if (r) nsMemory::Free(r); + if (decrypted) nsMemory::Free(decrypted); + if (decoded) nsMemory::Free(decoded); return rv; } @@ -257,7 +257,7 @@ loser: char *r = 0; // Allocate space for encoded string (with NUL) - r = (char *)nsAllocator::Alloc(dataLen+1); + r = (char *)nsMemory::Alloc(dataLen+1); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, data, dataLen); @@ -267,7 +267,7 @@ loser: r = 0; loser: - if (r) nsAllocator::Free(r); + if (r) nsMemory::Free(r); return rv; #endif @@ -301,7 +301,7 @@ loser: // Allocate space for decoded string (missing NUL) rLen = PL_strlen(data); - r = (unsigned char *)nsAllocator::Alloc(rLen); + r = (unsigned char *)nsMemory::Alloc(rLen); if (!r) { rv = NS_ERROR_OUT_OF_MEMORY; goto loser; } memcpy(r, data, rLen); @@ -311,7 +311,7 @@ loser: *_retval = rLen; loser: - if (r) nsAllocator::Free(r); + if (r) nsMemory::Free(r); return rv; #endif diff --git a/mozilla/extensions/psm-glue/src/nsSSLIOLayer.cpp b/mozilla/extensions/psm-glue/src/nsSSLIOLayer.cpp index 84ead0e1b57..a1fe63a3a03 100644 --- a/mozilla/extensions/psm-glue/src/nsSSLIOLayer.cpp +++ b/mozilla/extensions/psm-glue/src/nsSSLIOLayer.cpp @@ -456,7 +456,7 @@ nsPSMSocketInfo::GetPickledStatus(char * *pickledStatusString) if (mPickledStatus) { PRInt32 len = *(int*)mPickledStatus; - char *out = (char *)nsAllocator::Alloc(len); + char *out = (char *)nsMemory::Alloc(len); memcpy(out, mPickledStatus, len); *pickledStatusString = out; return NS_OK; diff --git a/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp b/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp index 8598b379803..45064f22e6c 100644 --- a/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp +++ b/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp @@ -438,7 +438,7 @@ nsSecureBrowserUIImpl::IsURLHTTPS(nsIURI* aURL, PRBool* value) if ( PL_strncasecmp(scheme, "https", 5) == 0 ) *value = PR_TRUE; - nsAllocator::Free(scheme); + nsMemory::Free(scheme); return NS_OK; } @@ -454,7 +454,7 @@ void nsSecureBrowserUIImpl::GetBundleString(const nsString& name, nsString &outS else outString.SetLength(0);; - nsAllocator::Free(ptrv); + nsMemory::Free(ptrv); } else { diff --git a/mozilla/extensions/wallet/cookieviewer/nsCookieViewer.cpp b/mozilla/extensions/wallet/cookieviewer/nsCookieViewer.cpp index 18087fc5ed2..c68f8e9c4ed 100644 --- a/mozilla/extensions/wallet/cookieviewer/nsCookieViewer.cpp +++ b/mozilla/extensions/wallet/cookieviewer/nsCookieViewer.cpp @@ -21,7 +21,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" #include "nsICookieService.h" diff --git a/mozilla/extensions/wallet/editor/nsWalletEditor.cpp b/mozilla/extensions/wallet/editor/nsWalletEditor.cpp index ae373c58a91..3511802faa6 100644 --- a/mozilla/extensions/wallet/editor/nsWalletEditor.cpp +++ b/mozilla/extensions/wallet/editor/nsWalletEditor.cpp @@ -21,7 +21,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" #include "nsIWalletService.h" diff --git a/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp b/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp index 52a513b407a..d553bfb9609 100644 --- a/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp +++ b/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp @@ -22,7 +22,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" #include "nsIWalletService.h" diff --git a/mozilla/extensions/wallet/src/nsBasicStreamGenerator.cpp b/mozilla/extensions/wallet/src/nsBasicStreamGenerator.cpp index a6da8951115..71ae01acd7f 100644 --- a/mozilla/extensions/wallet/src/nsBasicStreamGenerator.cpp +++ b/mozilla/extensions/wallet/src/nsBasicStreamGenerator.cpp @@ -78,7 +78,7 @@ NS_IMETHODIMP nsBasicStreamGenerator::GetByte(PRUint32 offset, PRUint8 *retval) return rv; } mPassword = aPassword; - nsAllocator::Free(aPassword); + nsMemory::Free(aPassword); mState = 0; } diff --git a/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp b/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp index 880aba1773d..1c97175a3b5 100644 --- a/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp +++ b/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp @@ -21,7 +21,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" #include "nsIWalletService.h" diff --git a/mozilla/extensions/xmlterm/base/mozLineTerm.cpp b/mozilla/extensions/xmlterm/base/mozLineTerm.cpp index b70b82bea33..586b3bff21f 100644 --- a/mozilla/extensions/xmlterm/base/mozLineTerm.cpp +++ b/mozilla/extensions/xmlterm/base/mozLineTerm.cpp @@ -29,7 +29,7 @@ #include "nsCOMPtr.h" #include "nsString.h" #include "prlog.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIServiceManager.h" #include "nsIPref.h" @@ -193,7 +193,7 @@ NS_IMETHODIMP mozLineTerm::ArePrefsSecure(PRBool *_retval) result = prefService->CopyCharPref("javascript.security_policy", &policyStr); if (NS_SUCCEEDED(result) && policyStr) { secString.Append(policyStr); - nsAllocator::Free(policyStr); + nsMemory::Free(policyStr); } else { secString.Append("default"); } @@ -205,7 +205,7 @@ NS_IMETHODIMP mozLineTerm::ArePrefsSecure(PRBool *_retval) char *secLevelString; result = prefService->CopyCharPref(prefStr, &secLevelString); - nsAllocator::Free(prefStr); + nsMemory::Free(prefStr); if (NS_FAILED(result) || !secLevelString) return NS_ERROR_FAILURE; @@ -214,7 +214,7 @@ NS_IMETHODIMP mozLineTerm::ArePrefsSecure(PRBool *_retval) ("secLevelString=%s\n", secLevelString)); *_retval = (PL_strcmp(secLevelString, "sameOrigin") == 0); - nsAllocator::Free(secLevelString); + nsMemory::Free(secLevelString); if (!(*_retval)) { XMLT_ERROR("mozLineTerm::ArePrefsSecure: Error - Please add the line\n" @@ -259,7 +259,7 @@ NS_IMETHODIMP mozLineTerm::GetSecurePrincipal(nsIDOMDocument *domDoc, #else const char temStr[] = "unknown"; PRInt32 temLen = strlen(temStr); - *aPrincipalStr = strncpy((char*) nsAllocator::Alloc(temLen+1), + *aPrincipalStr = strncpy((char*) nsMemory::Alloc(temLen+1), temStr, temLen+1); #endif @@ -272,8 +272,8 @@ NS_IMETHODIMP mozLineTerm::GetSecurePrincipal(nsIDOMDocument *domDoc, // Return null string XMLT_ERROR("mozLineTerm::GetSecurePrincipal: Error - " "Insecure document principal %s\n", *aPrincipalStr); - nsAllocator::Free(*aPrincipalStr); - *aPrincipalStr = (char*) nsAllocator::Alloc(1); + nsMemory::Free(*aPrincipalStr); + *aPrincipalStr = (char*) nsMemory::Alloc(1); **aPrincipalStr = '\0'; } @@ -334,7 +334,7 @@ NS_IMETHODIMP mozLineTerm::OpenAux(const PRUnichar *command, return NS_ERROR_FAILURE; if (strlen(securePrincipal) == 0) { - nsAllocator::Free(securePrincipal); + nsMemory::Free(securePrincipal); XMLT_ERROR("mozLineTerm::OpenAux: Error - " "Failed to create LineTerm for insecure document principal\n"); return NS_ERROR_FAILURE; @@ -404,7 +404,7 @@ NS_IMETHODIMP mozLineTerm::OpenAux(const PRUnichar *command, } // Free cookie CString - nsAllocator::Free(cookieCStr); + nsMemory::Free(cookieCStr); if (mLoggingEnabled) { // Log time stamp for LineTerm open operation @@ -414,7 +414,7 @@ NS_IMETHODIMP mozLineTerm::OpenAux(const PRUnichar *command, char* temStr = timeStamp.ToNewCString(); fprintf(stderr, " LineTerm %d opened by principal %s\n", temStr, mLTerm, securePrincipal); - nsAllocator::Free(temStr); + nsMemory::Free(temStr); } } @@ -573,7 +573,7 @@ NS_IMETHODIMP mozLineTerm::Write(const PRUnichar *buf, if (NS_SUCCEEDED(result) && (timeStamp.Length() > 0)) { char* temStr = timeStamp.ToNewCString(); fprintf(stderr, "\n", temStr); - nsAllocator::Free(temStr); + nsMemory::Free(temStr); } else if (newline) { fprintf(stderr, "\n"); @@ -645,7 +645,7 @@ NS_IMETHODIMP mozLineTerm::ReadAux(PRInt32 *opcodes, PRInt32 *opvals, XMLT_LOG(mozLineTerm::ReadAux,72,("cursor_col=%d\n", cursor_col)); int allocBytes = sizeof(PRUnichar)*(retCode + 1); - *_retval = (PRUnichar*) nsAllocator::Alloc(allocBytes); + *_retval = (PRUnichar*) nsMemory::Alloc(allocBytes); for (j=0; jReadAux(&opcodes, &opvals, &buf_row, &buf_col, &buf_str, &buf_style); if (NS_FAILED(result)) { @@ -466,9 +466,9 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, bufString = buf_str; bufStyle = buf_style; - // De-allocate buf_str, buf_style using nsAllocator::Free - nsAllocator::Free(buf_str); - nsAllocator::Free(buf_style); + // De-allocate buf_str, buf_style using nsMemory::Free + nsMemory::Free(buf_str); + nsMemory::Free(buf_style); char* temCString = bufString.ToNewCString(); XMLT_LOG(mozXMLTermSession::ReadAll,68,("bufString=%s\n", temCString)); @@ -2955,7 +2955,7 @@ NS_IMETHODIMP mozXMLTermSession::SetHistory(PRInt32 aHistory) // Get HTML prompt string NS_IMETHODIMP mozXMLTermSession::GetPrompt(PRUnichar **_aPrompt) { - // NOTE: Need to be sure that this may be freed by nsAllocator::Free + // NOTE: Need to be sure that this may be freed by nsMemory::Free *_aPrompt = mPromptHTML.ToNewUnicode(); return NS_OK; } diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp index b42f576edca..e43c314d5fc 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermStream.cpp @@ -27,7 +27,7 @@ #include "nsCOMPtr.h" #include "nsString.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIServiceManager.h" #include "nsIIOService.h" @@ -587,7 +587,7 @@ NS_IMETHODIMP mozXMLTermStream::Write(const PRUnichar* buf) // Convert Unicode string to UTF8 and store in buffer char* utf8Str = strBuf.ToNewUTF8String(); mUTF8Buffer = utf8Str; - nsAllocator::Free(utf8Str); + nsMemory::Free(utf8Str); mUTF8Offset = 0; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index 4b3559e9f70..6cbe3ac00b6 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -780,7 +780,7 @@ NS_IMETHODIMP mozXMLTerminal::Paste() char* temCStr = flavor.ToNewCString(); XMLT_LOG(mozXMLTerminal::Paste,20,("flavour=%s\n", temCStr)); - nsAllocator::Free(temCStr); + nsMemory::Free(temCStr); if (flavor.EqualsWithConversion(kHTMLMime) || flavor.EqualsWithConversion(kUnicodeMime)) { nsCOMPtr textDataObj ( do_QueryInterface(genericDataObj) ); @@ -791,7 +791,7 @@ NS_IMETHODIMP mozXMLTerminal::Paste() result = SendTextAux(pasteString); } } - nsAllocator::Free(bestFlavor); + nsMemory::Free(bestFlavor); return NS_OK; } diff --git a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp index fe3bc2c367e..46ee53fe4e5 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -814,7 +814,7 @@ NS_IMETHODIMP nsFontMetricsGTK::Init(const nsFont& aFont, nsIAtom* aLangGroup, gPref->CopyCharPref("font.default", &value); if (value) { mDefaultFont = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } else { @@ -881,7 +881,7 @@ NS_IMETHODIMP nsFontMetricsGTK::Init(const nsFont& aFont, nsIAtom* aLangGroup, gPref->CopyCharPref(name.GetBuffer(), &value); if (value) { mUserDefined = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; mIsUserDefined = 1; } @@ -1788,7 +1788,7 @@ nsFontGTKSubstitute::Convert(const PRUnichar* aSrc, PRUint32 aSrcLen, } p++; } - nsAllocator::Free(conv); + nsMemory::Free(conv); conv = nsnull; return i; } @@ -2863,7 +2863,7 @@ PrefEnumCallback(const char* aName, void* aClosure) nsCAutoString name; if (value) { name = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; s->mFont = s->mMetrics->TryNode(&name, s->mChar); } @@ -2873,7 +2873,7 @@ PrefEnumCallback(const char* aName, void* aClosure) gPref->CopyDefaultCharPref(aName, &value); if (value) { name = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; s->mFont = s->mMetrics->TryNode(&name, s->mChar); } @@ -2899,7 +2899,7 @@ nsFontMetricsGTK::FindGenericFont(PRUnichar aChar) nsFontGTK* font; if (value) { str = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; font = TryNode(&str, aChar); if (font && font->SupportsChar(aChar)) { @@ -2910,7 +2910,7 @@ nsFontMetricsGTK::FindGenericFont(PRUnichar aChar) gPref->CopyDefaultCharPref(pref.GetBuffer(), &value); if (value) { str = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; font = TryNode(&str, aChar); if (font && font->SupportsChar(aChar)) { @@ -3068,7 +3068,7 @@ EnumerateNode(void* aElement, void* aData) PRUnichar* str = node->mName.ToNewUnicode(); if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } info->mIndex = 0; return PR_FALSE; // stop @@ -3100,13 +3100,13 @@ EnumFonts(nsIAtom* aLangGroup, const char* aGeneric, PRUint32* aCount, } PRUnichar** array = - (PRUnichar**) nsAllocator::Alloc(gGlobalList->Count() * sizeof(PRUnichar*)); + (PRUnichar**) nsMemory::Alloc(gGlobalList->Count() * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } EnumerateNodeInfo info = { array, 0, aLangGroup }; if (!gGlobalList->EnumerateForwards(EnumerateNode, &info)) { - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } @@ -3118,7 +3118,7 @@ EnumFonts(nsIAtom* aLangGroup, const char* aGeneric, PRUint32* aCount, *aResult = array; } else { - nsAllocator::Free(array); + nsMemory::Free(array); } return NS_OK; diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index 80ec36ca90d..d4f63df8076 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -1007,7 +1007,7 @@ EnumerateFamily(nsHashKey *aKey, void *aData, void* closure) PRUnichar* str = (((FontNameKey*)aKey)->mString).ToNewUnicode(); if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } info->mIndex = 0; return PR_FALSE; @@ -1041,7 +1041,7 @@ nsFontEnumeratorMac::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) } PRInt32 items = list->Count(); PRUnichar** array = (PRUnichar**) - nsAllocator::Alloc(items * sizeof(PRUnichar*)); + nsMemory::Alloc(items * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } @@ -1049,7 +1049,7 @@ nsFontEnumeratorMac::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) list->Enumerate ( EnumerateFamily, &info); NS_ASSERTION( items == info.mIndex, "didn't get all the fonts"); if (!info.mIndex) { - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } @@ -1076,7 +1076,7 @@ EnumerateFont(nsHashKey *aKey, void *aData, void* closure) PRUnichar* str = (((FontNameKey*)aKey)->mString).ToNewUnicode(); if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } info->mIndex = 0; return PR_FALSE; @@ -1119,7 +1119,7 @@ nsFontEnumeratorMac::EnumerateFonts(const char* aLangGroup, } PRInt32 items = list->Count(); PRUnichar** array = (PRUnichar**) - nsAllocator::Alloc(items * sizeof(PRUnichar*)); + nsMemory::Alloc(items * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } @@ -1132,7 +1132,7 @@ nsFontEnumeratorMac::EnumerateFonts(const char* aLangGroup, EnumerateFontInfo info = { array, 0 , 0, gUtil->MapLangGroupToScriptCode(aLangGroup) ,gUtil->MapGenericFontNameType(GenName) }; list->Enumerate ( EnumerateFont, &info); if (!info.mIndex) { - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/gfx/src/mac/nsUnicodeRenderingToolkit.cpp b/mozilla/gfx/src/mac/nsUnicodeRenderingToolkit.cpp index 43893e59599..69d7cf4f573 100644 --- a/mozilla/gfx/src/mac/nsUnicodeRenderingToolkit.cpp +++ b/mozilla/gfx/src/mac/nsUnicodeRenderingToolkit.cpp @@ -388,7 +388,7 @@ PRBool nsUnicodeRenderingToolkit :: TransliterateFallbackGetWidth( } - nsAllocator::Free(conv); + nsMemory::Free(conv); return PR_TRUE; } } @@ -446,7 +446,7 @@ PRBool nsUnicodeRenderingToolkit :: TransliterateFallbackDrawChar( } else { DrawScriptText(conv, l, x, y, oWidth); } - nsAllocator::Free(conv); + nsMemory::Free(conv); return PR_TRUE; } } diff --git a/mozilla/gfx/src/photon/nsFontMetricsPh.cpp b/mozilla/gfx/src/photon/nsFontMetricsPh.cpp index da878df0f80..6eb41e638cd 100644 --- a/mozilla/gfx/src/photon/nsFontMetricsPh.cpp +++ b/mozilla/gfx/src/photon/nsFontMetricsPh.cpp @@ -606,7 +606,7 @@ EnumerateFamily(PLHashEntry* he, PRIntn i, void* arg) if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } info->mIndex = 0; return HT_ENUMERATE_STOP; @@ -658,7 +658,7 @@ nsFontEnumeratorPh::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) if (gFamilies) { - PRUnichar** array = (PRUnichar**) nsAllocator::Alloc(gFamilies->nentries * sizeof(PRUnichar*)); + PRUnichar** array = (PRUnichar**) nsMemory::Alloc(gFamilies->nentries * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; @@ -668,7 +668,7 @@ nsFontEnumeratorPh::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) PL_HashTableEnumerateEntries(gFamilies, EnumerateFamily, &info); if (!info.mIndex) { - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp index f9d50c860aa..3f95a30889e 100644 --- a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp +++ b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp @@ -2378,14 +2378,14 @@ nsFontMetricsWin::LoadGenericFont(HDC aDC, PRUnichar aChar, char** aName) } } if (found) { - nsAllocator::Free(*aName); + nsMemory::Free(*aName); *aName = nsnull; return nsnull; } PRUnichar name[LF_FACESIZE] = { 0 }; PRUnichar format[] = { '%', 's', 0 }; PRUint32 n = nsTextFormatter::snprintf(name, LF_FACESIZE, format, *aName); - nsAllocator::Free(*aName); + nsMemory::Free(*aName); *aName = nsnull; if (n && (n != (PRUint32) -1)) { nsAutoString fontName(name); @@ -2541,7 +2541,7 @@ HDC dc1 = NULL; gPref->CopyUnicharPref("font.default", &value); if (value) { mDefaultFont = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } else { @@ -2583,7 +2583,7 @@ HDC dc1 = NULL; gPref->CopyUnicharPref(name.GetBuffer(), &value); if (value) { mUserDefined = value; - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; mIsUserDefined = 1; } @@ -3882,14 +3882,14 @@ nsFontMetricsWinA::LoadGenericFont(HDC aDC, PRUnichar aChar, char** aName) } } if (found) { - nsAllocator::Free(*aName); + nsMemory::Free(*aName); *aName = nsnull; return nsnull; } PRUnichar name[LF_FACESIZE] = { 0 }; PRUnichar format[] = { '%', 's', 0 }; PRUint32 n = nsTextFormatter::snprintf(name, LF_FACESIZE, format, *aName); - nsAllocator::Free(*aName); + nsMemory::Free(*aName); *aName = nsnull; if (n && (n != (PRUint32) -1)) { nsAutoString fontName(name); @@ -4082,7 +4082,7 @@ nsFontEnumeratorWin::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) } PRUnichar** array = (PRUnichar**) - nsAllocator::Alloc(nsFontMetricsWin::gGlobalFontsCount * sizeof(PRUnichar*)); + nsMemory::Alloc(nsFontMetricsWin::gGlobalFontsCount * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } @@ -4090,9 +4090,9 @@ nsFontEnumeratorWin::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) PRUnichar* str = nsFontMetricsWin::gGlobalFonts[i].name->ToNewUnicode(); if (!str) { for (i = i - 1; i >= 0; i--) { - nsAllocator::Free(array[i]); + nsMemory::Free(array[i]); } - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } array[i] = str; @@ -4222,7 +4222,7 @@ nsFontEnumeratorWin::EnumerateFonts(const char* aLangGroup, } PRUnichar** array = (PRUnichar**) - nsAllocator::Alloc(nsFontMetricsWin::gGlobalFontsCount * sizeof(PRUnichar*)); + nsMemory::Alloc(nsFontMetricsWin::gGlobalFontsCount * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } @@ -4235,9 +4235,9 @@ nsFontEnumeratorWin::EnumerateFonts(const char* aLangGroup, PRUnichar* str = nsFontMetricsWin::gGlobalFonts[i].name->ToNewUnicode(); if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } array[j] = str; diff --git a/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp b/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp index 7e3e7bb65c4..47ffaf6b0a9 100644 --- a/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp +++ b/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp @@ -2300,7 +2300,7 @@ PrefEnumCallback(const char* aName, void* aClosure) nsAutoString name; if (value) { name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(search, &name); } @@ -2308,7 +2308,7 @@ PrefEnumCallback(const char* aName, void* aClosure) gPref->CopyDefaultCharPref(aName, &value); if (value) { name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(search, &name); } @@ -2339,7 +2339,7 @@ nsFontMetricsXlib::FindGenericFont(nsFontSearch* aSearch) gPref->CopyCharPref("font.default", &value); if (value) { prefix.AppendWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } else { @@ -2358,7 +2358,7 @@ nsFontMetricsXlib::FindGenericFont(nsFontSearch* aSearch) nsAutoString str; if (value) { str.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(aSearch, &str); if (aSearch->mFont) { @@ -2369,7 +2369,7 @@ nsFontMetricsXlib::FindGenericFont(nsFontSearch* aSearch) gPref->CopyDefaultCharPref(name, &value); if (value) { str.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(aSearch, &str); if (aSearch->mFont) { diff --git a/mozilla/gfx/src/xprint/nsFontMetricsXP.cpp b/mozilla/gfx/src/xprint/nsFontMetricsXP.cpp index 3da78442b88..453b1ac14a5 100644 --- a/mozilla/gfx/src/xprint/nsFontMetricsXP.cpp +++ b/mozilla/gfx/src/xprint/nsFontMetricsXP.cpp @@ -1523,7 +1523,7 @@ nsFontXPSubstitute::Convert(const PRUnichar* aSrc, PRUint32 aSrcLen, } p++; } - nsAllocator::Free(conv); + nsMemory::Free(conv); conv = nsnull; return i; } @@ -2626,7 +2626,7 @@ PrefEnumCallback(const char* aName, void* aClosure) nsAutoString name; if (value) { name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(search, &name); } @@ -2634,7 +2634,7 @@ PrefEnumCallback(const char* aName, void* aClosure) gPref->CopyDefaultCharPref(aName, &value); if (value) { name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(search, &name); } @@ -2665,7 +2665,7 @@ nsFontMetricsXP::FindGenericFont(nsFontSearch* aSearch) gPref->CopyCharPref("font.default", &value); if (value) { prefix.AppendWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } else { @@ -2684,7 +2684,7 @@ nsFontMetricsXP::FindGenericFont(nsFontSearch* aSearch) nsAutoString str; if (value) { str.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(aSearch, &str); if (aSearch->mFont) { @@ -2695,7 +2695,7 @@ nsFontMetricsXP::FindGenericFont(nsFontSearch* aSearch) gPref->CopyDefaultCharPref(name, &value); if (value) { str.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; FindFamily(aSearch, &str); if (aSearch->mFont) { @@ -2848,7 +2848,7 @@ EnumerateFamily(PLHashEntry* he, PRIntn i, void* arg) PRUnichar* str = ((nsString*) he->key)->ToNewUnicode(); if (!str) { for (j = j - 1; j >= 0; j--) { - nsAllocator::Free(array[j]); + nsMemory::Free(array[j]); } info->mIndex = 0; return HT_ENUMERATE_STOP; @@ -2893,14 +2893,14 @@ nsFontEnumeratorXP::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) } PRUnichar** array = (PRUnichar**) - nsAllocator::Alloc(gFamilies->nentries * sizeof(PRUnichar*)); + nsMemory::Alloc(gFamilies->nentries * sizeof(PRUnichar*)); if (!array) { return NS_ERROR_OUT_OF_MEMORY; } EnumerateFamilyInfo info = { array, 0 }; PL_HashTableEnumerateEntries(gFamilies, EnumerateFamily, &info); if (!info.mIndex) { - nsAllocator::Free(array); + nsMemory::Free(array); return NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp index 737fb566968..89043f7b895 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -157,7 +157,7 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream, nsHTMLContentSinkStream::~nsHTMLContentSinkStream() { if (mBuffer) - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); } /** diff --git a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 4646d4c224b..8f292e275fe 100644 --- a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -890,9 +890,9 @@ void nsHTMLToTXTSinkStream::EnsureBufferSize(PRInt32 aNewSize) { if (mBufferSize < aNewSize) { - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBufferSize = 2*aNewSize+1; // make the twice as large - mBuffer = NS_STATIC_CAST(char*, nsAllocator::Alloc(mBufferSize)); + mBuffer = NS_STATIC_CAST(char*, nsMemory::Alloc(mBufferSize)); if(mBuffer){ mBuffer[0] = 0; mBufferLength = 0; @@ -1208,7 +1208,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString) #ifdef DEBUG_wrapping char* foo = aString.ToNewCString(); printf("Write(%s): wrap col = %d, mColPos = %d\n", foo, mWrapColumn, mColPos); - nsAllocator::Free(foo); + nsMemory::Free(foo); #endif PRInt32 bol = 0; @@ -1297,7 +1297,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString) foo = remaining.ToNewCString(); // printf("Next line: bol = %d, newlinepos = %d, totLen = %d, string = '%s'\n", // bol, nextpos, totLen, foo); - nsAllocator::Free(foo); + nsMemory::Free(foo); #endif if(nextpos < 0) { diff --git a/mozilla/intl/compatibility/tests/TestI18nCompatibility.cpp b/mozilla/intl/compatibility/tests/TestI18nCompatibility.cpp index 0f122f25472..089ea4eafd5 100644 --- a/mozilla/intl/compatibility/tests/TestI18nCompatibility.cpp +++ b/mozilla/intl/compatibility/tests/TestI18nCompatibility.cpp @@ -65,7 +65,7 @@ int main(int argc, char** argv) { nsString tempStr(charsetUni); char *tempCstr = tempStr.ToNewCString(); - nsAllocator::Free(charsetUni); + nsMemory::Free(charsetUni); if (NULL != tempCstr) { cout << csid << " " << tempCstr << "\n"; diff --git a/mozilla/intl/locale/src/mac/nsCollationMac.cpp b/mozilla/intl/locale/src/mac/nsCollationMac.cpp index 0b6ce501af4..4e557f6f6a3 100644 --- a/mozilla/intl/locale/src/mac/nsCollationMac.cpp +++ b/mozilla/intl/locale/src/mac/nsCollationMac.cpp @@ -165,7 +165,7 @@ nsresult nsCollationMac::Initialize(nsILocale* locale) if (NS_SUCCEEDED(res)) { nsAutoString aLocale(aLocaleUnichar); - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); short scriptcode, langcode, regioncode; nsCOMPtr macLocale = do_GetService(kMacLocaleFactoryCID, &res); @@ -181,7 +181,7 @@ nsresult nsCollationMac::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(aLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset.Assign(mappedCharset); - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp b/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp index 850ea82c521..bb3c495772f 100644 --- a/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp +++ b/mozilla/intl/locale/src/mac/nsDateTimeFormatMac.cpp @@ -239,10 +239,10 @@ nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale) res = locale->GetCategory(aCategory.GetUnicode(), &aLocaleUnichar); if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { if (mLocale.Length() && mLocale.EqualsIgnoreCase(aLocaleUnichar)) { - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); return NS_OK; } - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); } } @@ -274,7 +274,7 @@ nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale) // Get a script code and charset name from locale, if available if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { mLocale.Assign(aLocaleUnichar); // cache locale name - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); nsCOMPtr macLocale = do_GetService(kMacLocaleFactoryCID, &res); if (NS_SUCCEEDED(res)) { @@ -287,7 +287,7 @@ nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(mLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset.Assign(mappedCharset); - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/locale/src/unix/nsCollationUnix.cpp b/mozilla/intl/locale/src/unix/nsCollationUnix.cpp index 7f3ff92fb31..eae4315682c 100644 --- a/mozilla/intl/locale/src/unix/nsCollationUnix.cpp +++ b/mozilla/intl/locale/src/unix/nsCollationUnix.cpp @@ -124,7 +124,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale) nsString aLocale; aLocale = aLocaleUnichar; if (NULL != aLocaleUnichar) { - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); } // keep the same behavior as 4.x as well as avoiding Linux collation key problem @@ -147,7 +147,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(aLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset = mappedCharset; - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index d97ec6f38c8..ae9992fedfd 100644 --- a/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/mozilla/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -61,10 +61,10 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) res = locale->GetCategory(aCategory.GetUnicode(), &aLocaleUnichar); if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { if (mLocale.Length() && mLocale.EqualsIgnoreCase(aLocaleUnichar)) { - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); return NS_OK; } - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); } } @@ -92,7 +92,7 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { mLocale = aLocaleUnichar; // cache locale name - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); nsCOMPtr posixLocale = do_GetService(kPosixLocaleFactoryCID, &res); if (NS_SUCCEEDED(res)) { @@ -105,7 +105,7 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(mLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset = mappedCharset; - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/locale/src/windows/nsCollationWin.cpp b/mozilla/intl/locale/src/windows/nsCollationWin.cpp index b416491ae28..8f73664c420 100644 --- a/mozilla/intl/locale/src/windows/nsCollationWin.cpp +++ b/mozilla/intl/locale/src/windows/nsCollationWin.cpp @@ -108,7 +108,7 @@ nsresult nsCollationWin::Initialize(nsILocale* locale) nsString aLocale; aLocale.Assign(aLocaleUnichar); if (NULL != aLocaleUnichar) { - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); } nsCOMPtr win32Locale = do_GetService(kWin32LocaleFactoryCID, &res); @@ -126,7 +126,7 @@ nsresult nsCollationWin::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(aLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset.Assign(mappedCharset); - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp b/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp index 1769022e6ab..f8e3df15920 100644 --- a/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp +++ b/mozilla/intl/locale/src/windows/nsDateTimeFormatWin.cpp @@ -66,10 +66,10 @@ nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale) res = locale->GetCategory(aCategory.GetUnicode(), &aLocaleUnichar); if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { if (mLocale.Length() && mLocale.EqualsIgnoreCase(aLocaleUnichar)) { - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); return NS_OK; } - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); } } @@ -113,7 +113,7 @@ nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale) // Get LCID and charset name from locale, if available if (NS_SUCCEEDED(res) && NULL != aLocaleUnichar) { mLocale.Assign(aLocaleUnichar); // cache locale name - nsAllocator::Free(aLocaleUnichar); + nsMemory::Free(aLocaleUnichar); nsCOMPtr win32Locale = do_GetService(kWin32LocaleFactoryCID, &res); if (NS_SUCCEEDED(res)) { @@ -126,7 +126,7 @@ nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale) res = platformCharset->GetDefaultCharsetForLocale(mLocale.GetUnicode(), &mappedCharset); if (NS_SUCCEEDED(res) && mappedCharset) { mCharset.Assign(mappedCharset); - nsAllocator::Free(mappedCharset); + nsMemory::Free(mappedCharset); } } } diff --git a/mozilla/intl/strres/src/nsAcceptLang.cpp b/mozilla/intl/strres/src/nsAcceptLang.cpp index ed2a3d6aba1..7040c85b402 100644 --- a/mozilla/intl/strres/src/nsAcceptLang.cpp +++ b/mozilla/intl/strres/src/nsAcceptLang.cpp @@ -23,7 +23,7 @@ #define NS_IMPL_IDS #include "prmem.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIServiceManager.h" #include "nsID.h" #include "nsString.h" diff --git a/mozilla/intl/strres/src/nsStringBundle.cpp b/mozilla/intl/strres/src/nsStringBundle.cpp index c3eb56f719f..444e05d692c 100644 --- a/mozilla/intl/strres/src/nsStringBundle.cpp +++ b/mozilla/intl/strres/src/nsStringBundle.cpp @@ -28,7 +28,7 @@ #include "nsIStringBundle.h" #include "nscore.h" #include "nsILocale.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "nsNetUtil.h" #include "nsIURL.h" @@ -326,7 +326,7 @@ nsStringBundle::GetLangCountry(nsILocale* aLocale, nsString& lang, nsString& cou nsString category; category.AssignWithConversion("NSILOCALE_MESSAGES"); nsresult result = aLocale->GetCategory(category.GetUnicode(), &lc_name_unichar); lc_name.Assign(lc_name_unichar); - nsAllocator::Free(lc_name_unichar); + nsMemory::Free(lc_name_unichar); NS_ASSERTION(NS_SUCCEEDED(result),"nsStringBundle::GetLangCountry: locale.GetCategory failed"); NS_ASSERTION(lc_name.Length()>0,"nsStringBundle::GetLangCountry: locale.GetCategory failed"); diff --git a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp index 0e6840c09d7..f750fc4889e 100644 --- a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp @@ -219,7 +219,7 @@ nsresult nsCharsetConverterManager::RegisterConverterTitles( char * p = str.ToNewCString(); res = aRegistry->AddSubtree(nsIRegistry::Common, p, &key); - nsAllocator::Free(p); + nsMemory::Free(p); if (NS_FAILED(res)) return res; res = aRegistry->SetStringUTF8(key, "name", "chrome://global/locale/charsetTitles.properties"); if (NS_FAILED(res)) return res; @@ -239,7 +239,7 @@ nsresult nsCharsetConverterManager::RegisterConverterData( char * p = str.ToNewCString(); res = aRegistry->AddSubtree(nsIRegistry::Common, p, &key); - nsAllocator::Free(p); + nsMemory::Free(p); if (NS_FAILED(res)) return res; res = aRegistry->SetStringUTF8(key, "name", "resource:/res/charsetData.properties"); if (NS_FAILED(res)) return res; diff --git a/mozilla/intl/uconv/src/nsCharsetMenu.cpp b/mozilla/intl/uconv/src/nsCharsetMenu.cpp index dfbdf84d5ae..7e7f4666034 100644 --- a/mozilla/intl/uconv/src/nsCharsetMenu.cpp +++ b/mozilla/intl/uconv/src/nsCharsetMenu.cpp @@ -911,7 +911,7 @@ nsresult nsCharsetMenu::AddFromPrefsToMenu( if (value != NULL) { res = AddFromStringToMenu(value, aRDFServ, aCCMan, aArray, aContainer, aDecs, aIDPrefix); - nsAllocator::Free(value); + nsMemory::Free(value); } return res; diff --git a/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp b/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp index d93b5672c14..59a71dcfe71 100644 --- a/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp +++ b/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp @@ -116,7 +116,7 @@ nsSaveAsCharset::Convert(const PRUnichar *inString, char **_retval) if(NS_SUCCEEDED(rv)) { if (NULL == entity) return NS_ERROR_OUT_OF_MEMORY; rv = DoCharsetConversion(entity, _retval); - nsAllocator::Free(entity); + nsMemory::Free(entity); } } else { @@ -275,7 +275,7 @@ nsSaveAsCharset::DoConversionFallBack(PRUnichar inCharacter, char *outString, PR return NS_ERROR_OUT_OF_MEMORY; } PL_strcpy(outString, entity); - nsAllocator::Free(entity); + nsMemory::Free(entity); return rv; } } diff --git a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp index 73d7eae5f41..20f7cb1266d 100644 --- a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp +++ b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp @@ -388,7 +388,7 @@ static void TestEntityConversion(PRUint32 version) res = entityConv->ConvertToEntity(inString[i], version, &entity); if (NS_SUCCEEDED(res) && NULL != entity) { cout << inString[i] << " " << entity << "\n"; - nsAllocator::Free(entity); + nsMemory::Free(entity); } } @@ -401,7 +401,7 @@ static void TestEntityConversion(PRUint32 version) if (';' == (char) entities[i]) cout << "\n"; } - nsAllocator::Free(entities); + nsMemory::Free(entities); } cout << "==============================\n"; @@ -439,7 +439,7 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} cout << "ISO-2022-JP " << "attr_plainTextDefault " << "entityNone " << "\n"; res = saveAsCharset->Init("ISO-2022-JP", @@ -449,11 +449,11 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} if (NS_ERROR_UENC_NOMAPPING == res) { outString = inString.ToNewUTF8String(); if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << "Fall back to UTF-8: " << outString << "\n"; nsAllocator::Free(outString);} + else {cout << "Fall back to UTF-8: " << outString << "\n"; nsMemory::Free(outString);} } cout << "ISO-2022-JP " << "attr_FallbackQuestionMark " << "entityNone " << "\n"; @@ -464,7 +464,7 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} cout << "ISO-2022-JP " << "attr_FallbackEscapeU " << "entityNone " << "\n"; res = saveAsCharset->Init("ISO-2022-JP", @@ -474,7 +474,7 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} cout << "ISO-8859-1 " << "attr_htmlTextDefault " << "html40Latin1 " << "\n"; res = saveAsCharset->Init("ISO-8859-1", @@ -484,7 +484,7 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_ERROR_UENC_NOMAPPING != res && NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} cout << "ISO-8859-1 " << "attr_FallbackHexNCR+attr_EntityAfterCharsetConv " << "html40Latin1 " << "\n"; res = saveAsCharset->Init("ISO-8859-1", @@ -495,7 +495,7 @@ static void TestSaveAsCharset() res = saveAsCharset->Convert(inString.GetUnicode(), &outString); if (NS_ERROR_UENC_NOMAPPING != res && NS_FAILED(res)) {cout << "\tFailed!! return value != NS_OK\n";} if (NULL == outString) {cout << "\tFailed!! output null\n";} - else {cout << outString << "\n"; nsAllocator::Free(outString);} + else {cout << outString << "\n"; nsMemory::Free(outString);} cout << "==============================\n"; diff --git a/mozilla/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/mozilla/js/src/xpconnect/loader/mozJSComponentLoader.cpp index 202fa9e5ce7..23f5e65f66e 100644 --- a/mozilla/js/src/xpconnect/loader/mozJSComponentLoader.cpp +++ b/mozilla/js/src/xpconnect/loader/mozJSComponentLoader.cpp @@ -38,7 +38,7 @@ #include "nsIJSContextStack.h" #include "nsIXPConnect.h" #include "nsCRT.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIRegistry.h" #include "nsXPIDLString.h" #include "nsIObserverService.h" @@ -88,7 +88,7 @@ Dump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) *c = '\n'; #endif fputs(bytes, stderr); - nsAllocator::Free(bytes); + nsMemory::Free(bytes); return JS_TRUE; } @@ -245,7 +245,7 @@ Reporter(JSContext *cx, const char *message, JSErrorReport *rep) rv = errorObject->Init(rep->ucmessage, newFileUni, rep->uclinebuf, rep->lineno, column, rep->flags, "component javascript"); - nsAllocator::Free((void *)newFileUni); + nsMemory::Free((void *)newFileUni); if (NS_SUCCEEDED(rv)) { rv = consoleService->LogMessage(errorObject); if (NS_SUCCEEDED(rv)) { @@ -456,7 +456,7 @@ mozJSComponentLoader::SetRegistryInfo(const char *registryLocation, rv = mRegistry->AddSubtreeRaw(mXPCOMKey, eRegistryLocation, &key); if (registryLocation != eRegistryLocation) - nsAllocator::Free(eRegistryLocation); + nsMemory::Free(eRegistryLocation); if (NS_FAILED(rv)) return rv; @@ -504,7 +504,7 @@ mozJSComponentLoader::RemoveRegistryInfo(const char *registryLocation) rv = mRegistry->RemoveSubtree(mXPCOMKey, eRegistryLocation); if (registryLocation != eRegistryLocation) - nsAllocator::Free(eRegistryLocation); + nsMemory::Free(eRegistryLocation); return rv; } @@ -533,7 +533,7 @@ mozJSComponentLoader::HasChanged(const char *registryLocation, nsRegistryKey key; int r = NS_FAILED(mRegistry->GetSubtreeRaw(mXPCOMKey, eRegistryLocation, &key)); if (registryLocation != eRegistryLocation) - nsAllocator::Free(eRegistryLocation); + nsMemory::Free(eRegistryLocation); if (r) return PR_TRUE; diff --git a/mozilla/js/src/xpconnect/shell/xpcshell.cpp b/mozilla/js/src/xpconnect/shell/xpcshell.cpp index 3838b504d64..b44bbfee2d1 100644 --- a/mozilla/js/src/xpconnect/shell/xpcshell.cpp +++ b/mozilla/js/src/xpconnect/shell/xpcshell.cpp @@ -53,7 +53,7 @@ #include "jsapi.h" #include "jsprf.h" #include "nscore.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIGenericFactory.h" #include "nsIJSRuntimeService.h" #include "nsCOMPtr.h" @@ -196,7 +196,7 @@ Dump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) *c = '\n'; #endif fputs(bytes, gOutFile); - nsAllocator::Free(bytes); + nsMemory::Free(bytes); return JS_TRUE; } diff --git a/mozilla/js/src/xpconnect/src/nsXPConnect.cpp b/mozilla/js/src/xpconnect/src/nsXPConnect.cpp index 00051bb9c0b..fae9f5d721c 100644 --- a/mozilla/js/src/xpconnect/src/nsXPConnect.cpp +++ b/mozilla/js/src/xpconnect/src/nsXPConnect.cpp @@ -389,7 +389,7 @@ nsXPConnect::IsISupportsDescendant(nsIInterfaceInfo* info) if(NS_SUCCEEDED(oldest->GetIID(&iid))) { retval = iid->Equals(NS_GET_IID(nsISupports)); - nsAllocator::Free(iid); + nsMemory::Free(iid); } return retval; } diff --git a/mozilla/js/src/xpconnect/src/xpccomponents.cpp b/mozilla/js/src/xpconnect/src/xpccomponents.cpp index ef2b350f661..6b477c151ff 100644 --- a/mozilla/js/src/xpconnect/src/xpccomponents.cpp +++ b/mozilla/js/src/xpconnect/src/xpccomponents.cpp @@ -236,7 +236,7 @@ nsXPCComponents_Interfaces::FillCache(JSContext *cx, JSObject *obj, char *interface_name; Interface->GetName(&interface_name); RealizeInterface(cx, obj, interface_name, wrapper, arbitrary); - nsAllocator::Free(interface_name); + nsMemory::Free(interface_name); NS_RELEASE(Interface); } else @@ -474,7 +474,7 @@ nsXPCComponents_Classes::FillCache(JSContext *cx, JSObject *obj, if(NS_SUCCEEDED(ClassNameHolder->GetData(&class_name))) { RealizeClass(cx, obj, class_name, wrapper, arbitrary); - nsAllocator::Free(class_name); + nsMemory::Free(class_name); } NS_RELEASE(ClassNameHolder); } @@ -716,7 +716,7 @@ nsXPCComponents_ClassesByID::FillCache(JSContext *cx, JSObject *obj, arbitrary, JS_TRUE); delete [] class_name; } - nsAllocator::Free(class_id); + nsMemory::Free(class_id); } NS_RELEASE(ClassIDHolder); } @@ -762,13 +762,13 @@ IsCanonicalFormOfRegisteredCLSID(const char* str) if(NS_FAILED(rv)) return PR_FALSE; - char* copy = (char*)nsAllocator::Clone(str, (strlen(str)+1)*sizeof(char)); + char* copy = (char*)nsMemory::Clone(str, (strlen(str)+1)*sizeof(char)); if(!copy) return PR_FALSE; nsID id; PRBool idIsOK = id.Parse(copy); - nsAllocator::Free(copy); + nsMemory::Free(copy); if(!idIsOK) return PR_FALSE; @@ -1356,7 +1356,7 @@ nsXPCConstructor::nsXPCConstructor(nsIJSCID* aClassID, NS_IF_ADDREF(mClassID = aClassID); NS_IF_ADDREF(mInterfaceID = aInterfaceID); mInitializer = aInitializer ? - (char*) nsAllocator::Clone(aInitializer, strlen(aInitializer)+1) : + (char*) nsMemory::Clone(aInitializer, strlen(aInitializer)+1) : nsnull; } @@ -1365,7 +1365,7 @@ nsXPCConstructor::~nsXPCConstructor() NS_IF_RELEASE(mClassID); NS_IF_RELEASE(mInterfaceID); if(mInitializer) - nsAllocator::Free(mInitializer); + nsMemory::Free(mInitializer); } /* readonly attribute nsIJSCID classID; */ diff --git a/mozilla/js/src/xpconnect/src/xpcconvert.cpp b/mozilla/js/src/xpconnect/src/xpcconvert.cpp index 8dc0009acf7..45fc523d2aa 100644 --- a/mozilla/js/src/xpconnect/src/xpcconvert.cpp +++ b/mozilla/js/src/xpconnect/src/xpcconvert.cpp @@ -617,7 +617,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s, if(useAllocator) { int len = (JS_GetStringLength(str) + 1) * sizeof(char); - if(!(*((void**)d) = nsAllocator::Alloc(len))) + if(!(*((void**)d) = nsMemory::Alloc(len))) { return JS_FALSE; } @@ -655,7 +655,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s, if(useAllocator) { int byte_len = (JS_GetStringLength(str)+1)*sizeof(jschar); - if(!(*((void**)d) = nsAllocator::Alloc(byte_len))) + if(!(*((void**)d) = nsMemory::Alloc(byte_len))) { // XXX should report error return JS_FALSE; @@ -1080,7 +1080,7 @@ XPCConvert::JSErrorToXPCException(JSContext* cx, formattedMsg, ifaceName, methodName, data); if(formattedMsg) - nsAllocator::Free(formattedMsg); + nsMemory::Free(formattedMsg); NS_RELEASE(data); } else @@ -1298,7 +1298,7 @@ XPCConvert::JSArray2Native(JSContext* cx, void** d, jsval s, #define POPULATE(_mode, _t) \ PR_BEGIN_MACRO \ cleanupMode = _mode; \ - if(nsnull == (array = nsAllocator::Alloc(capacity * sizeof(_t)))) \ + if(nsnull == (array = nsMemory::Alloc(capacity * sizeof(_t)))) \ { \ if(pErr) \ *pErr = NS_ERROR_OUT_OF_MEMORY; \ @@ -1368,10 +1368,10 @@ failure: for(PRUint32 i = 0; i < initedCount; i++) { void* p = a[i]; - if(p) nsAllocator::Free(p); + if(p) nsMemory::Free(p); } } - nsAllocator::Free(array); + nsMemory::Free(array); } return JS_FALSE; @@ -1482,7 +1482,7 @@ XPCConvert::JSStringWithSize2Native(JSContext* cx, void* d, jsval s, if(useAllocator && 0 != capacity) { len = (capacity + 1) * sizeof(char); - if(!(*((void**)d) = nsAllocator::Alloc(len))) + if(!(*((void**)d) = nsMemory::Alloc(len))) return JS_FALSE; return JS_TRUE; } @@ -1512,7 +1512,7 @@ XPCConvert::JSStringWithSize2Native(JSContext* cx, void* d, jsval s, if(useAllocator) { JSUint32 alloc_len = (len + 1) * sizeof(char); - if(!(*((void**)d) = nsAllocator::Alloc(alloc_len))) + if(!(*((void**)d) = nsMemory::Alloc(alloc_len))) { return JS_FALSE; } @@ -1548,7 +1548,7 @@ XPCConvert::JSStringWithSize2Native(JSContext* cx, void* d, jsval s, if(useAllocator && 0 != capacity) { len = (capacity + 1) * sizeof(jschar); - if(!(*((void**)d) = nsAllocator::Alloc(len))) + if(!(*((void**)d) = nsMemory::Alloc(len))) return JS_FALSE; return JS_TRUE; } @@ -1577,7 +1577,7 @@ XPCConvert::JSStringWithSize2Native(JSContext* cx, void* d, jsval s, if(useAllocator) { JSUint32 alloc_len = (len + 1) * sizeof(jschar); - if(!(*((void**)d) = nsAllocator::Alloc(alloc_len))) + if(!(*((void**)d) = nsMemory::Alloc(alloc_len))) { // XXX should report error return JS_FALSE; diff --git a/mozilla/js/src/xpconnect/src/xpcexception.cpp b/mozilla/js/src/xpconnect/src/xpcexception.cpp index cbaf3439f12..14e7b91a36e 100644 --- a/mozilla/js/src/xpconnect/src/xpcexception.cpp +++ b/mozilla/js/src/xpconnect/src/xpcexception.cpp @@ -122,12 +122,12 @@ nsXPCException::Reset() { if(mMessage) { - nsAllocator::Free(mMessage); + nsMemory::Free(mMessage); mMessage = nsnull; } if(mName) { - nsAllocator::Free(mName); + nsMemory::Free(mName); mName = nsnull; } NS_IF_RELEASE(mLocation); @@ -206,14 +206,14 @@ nsXPCException::Initialize(const char *aMessage, nsresult aResult, const char *a if(aMessage) { - if(!(mMessage = (char*) nsAllocator::Clone(aMessage, + if(!(mMessage = (char*) nsMemory::Clone(aMessage, sizeof(char)*(strlen(aMessage)+1)))) return NS_ERROR_OUT_OF_MEMORY; } if(aName) { - if(!(mName = (char*) nsAllocator::Clone(aName, + if(!(mName = (char*) nsMemory::Clone(aName, sizeof(char)*(strlen(aName)+1)))) return NS_ERROR_OUT_OF_MEMORY; } @@ -281,12 +281,12 @@ nsXPCException::ToString(char **_retval) char* temp = JS_smprintf(format, msg, mResult, resultName, location, data); if(indicatedLocation) - nsAllocator::Free(indicatedLocation); + nsMemory::Free(indicatedLocation); char* final = nsnull; if(temp) { - final = (char*) nsAllocator::Clone(temp, sizeof(char)*(strlen(temp)+1)); + final = (char*) nsMemory::Clone(temp, sizeof(char)*(strlen(temp)+1)); JS_smprintf_free(temp); } @@ -379,9 +379,9 @@ xpcJSErrorReport::xpcJSErrorReport() xpcJSErrorReport::~xpcJSErrorReport() { - if(mMessage) nsAllocator::Free(mMessage); - if(mFilename) nsAllocator::Free(mFilename); - if(mLinebuf) nsAllocator::Free(mLinebuf); + if(mMessage) nsMemory::Free(mMessage); + if(mFilename) nsMemory::Free(mFilename); + if(mLinebuf) nsMemory::Free(mLinebuf); } // static @@ -401,18 +401,18 @@ xpcJSErrorReport::NewReport(const char* aMessage, JSBool success = JS_TRUE; - if(!(self->mMessage = (char*) nsAllocator::Clone(aMessage, + if(!(self->mMessage = (char*) nsMemory::Clone(aMessage, sizeof(char)*(strlen(aMessage)+1)))) success = JS_FALSE; if(success && aReport->filename) - if(!(self->mFilename = (char*) nsAllocator::Clone(aReport->filename, + if(!(self->mFilename = (char*) nsMemory::Clone(aReport->filename, sizeof(char)*(strlen(aReport->filename)+1)))) success = JS_FALSE; if(success && aReport->linebuf) { - if(!(self->mLinebuf = (char*) nsAllocator::Clone(aReport->linebuf, + if(!(self->mLinebuf = (char*) nsMemory::Clone(aReport->linebuf, sizeof(char)*(strlen(aReport->linebuf)+1)))) success = JS_FALSE; @@ -547,7 +547,7 @@ xpcJSErrorReport::ToString(char **_retval) char* final = nsnull; if(temp) { - final = (char*) nsAllocator::Clone(temp, + final = (char*) nsMemory::Clone(temp, sizeof(char)*(strlen(temp)+1)); JS_smprintf_free(temp); } diff --git a/mozilla/js/src/xpconnect/src/xpcjsid.cpp b/mozilla/js/src/xpconnect/src/xpcjsid.cpp index d78d3149a3b..82d8607cf81 100644 --- a/mozilla/js/src/xpconnect/src/xpcjsid.cpp +++ b/mozilla/js/src/xpconnect/src/xpcjsid.cpp @@ -107,7 +107,7 @@ nsJSID::GetName(char * *aName) if(!NameIsSet()) SetNameToNoString(); NS_ASSERTION(mName, "name not set"); - *aName = (char*) nsAllocator::Clone(mName, strlen(mName)+1); + *aName = (char*) nsMemory::Clone(mName, strlen(mName)+1); return *aName ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -123,7 +123,7 @@ nsJSID::GetNumber(char * *aNumber) mNumber = gNoString; } - *aNumber = (char*) nsAllocator::Clone(mNumber, strlen(mNumber)+1); + *aNumber = (char*) nsMemory::Clone(mNumber, strlen(mNumber)+1); return *aNumber ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -133,7 +133,7 @@ nsJSID::GetId(nsID* *aId) if(!aId) return NS_ERROR_NULL_POINTER; - *aId = (nsID*) nsAllocator::Clone(&mID, sizeof(nsID)); + *aId = (nsID*) nsMemory::Clone(&mID, sizeof(nsID)); return *aId ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -162,7 +162,7 @@ nsJSID::Equals(nsIJSID *other, PRBool *_retval) if(NS_SUCCEEDED(other->GetId(&otherID))) { *_retval = mID.Equals(*otherID); - nsAllocator::Free(otherID); + nsMemory::Free(otherID); } return NS_OK; } @@ -216,7 +216,7 @@ nsJSID::ToString(char **_retval) return NS_OK; } else - nsAllocator::Free(str); + nsMemory::Free(str); } } return GetNumber(_retval); @@ -314,7 +314,7 @@ nsJSIID::ResolveName() if(NS_SUCCEEDED(iim->GetNameForIID(mDetails.GetID(), &name)) && name) { mDetails.SetName(name); - nsAllocator::Free(name); + nsMemory::Free(name); } NS_RELEASE(iim); } @@ -358,7 +358,7 @@ nsJSIID::NewID(const char* str) NS_SUCCEEDED(iinfo->GetIID(&pid)) && pid) { success = idObj->mDetails.InitWithName(*pid, str); - nsAllocator::Free(pid); + nsMemory::Free(pid); } NS_RELEASE(iim); } @@ -417,7 +417,7 @@ nsJSIID::HasInstance(JSContext *cx, JSObject *obj, if(NS_SUCCEEDED(cur->GetIID(&iid))) { JSBool found = mDetails.GetID()->Equals(*iid); - nsAllocator::Free(iid); + nsMemory::Free(iid); if(found) { *bp = JS_TRUE; @@ -639,7 +639,7 @@ CIDCreateInstance::Call(JSContext *cx, JSObject *obj, if(sm && NS_OK != sm->CanCreateInstance(cx, *cid)) { // the security manager vetoed. It should have set an exception. - nsAllocator::Free(cid); + nsMemory::Free(cid); *rval = JSVAL_NULL; *retval = JS_FALSE; return NS_OK; @@ -661,7 +661,7 @@ CIDCreateInstance::Call(JSContext *cx, JSObject *obj, return NS_OK; } iid = *piid; - nsAllocator::Free(piid); + nsMemory::Free(piid); } else iid = NS_GET_IID(nsISupports); @@ -672,7 +672,7 @@ CIDCreateInstance::Call(JSContext *cx, JSObject *obj, rv = nsComponentManager::CreateInstance(*cid, nsnull, iid, (void**) getter_AddRefs(inst)); NS_ASSERTION(NS_FAILED(rv) || inst, "component manager returned success, but instance is null!"); - nsAllocator::Free(cid); + nsMemory::Free(cid); if(NS_FAILED(rv) || !inst) { @@ -801,7 +801,7 @@ CIDGetService::Call(JSContext *cx, JSObject *obj, if(sm && NS_OK != sm->CanGetService(cx, *cid)) { // the security manager vetoed. It should have set an exception. - nsAllocator::Free(cid); + nsMemory::Free(cid); *rval = JSVAL_NULL; *retval = JS_FALSE; return NS_OK; @@ -818,13 +818,13 @@ CIDGetService::Call(JSContext *cx, JSObject *obj, !(iidobj = JSVAL_TO_OBJECT(val)) || !(piid = xpc_JSObjectToID(cx, iidobj))) { - nsAllocator::Free(cid); + nsMemory::Free(cid); ThrowException(NS_ERROR_XPC_BAD_IID, cx); *retval = JS_FALSE; return NS_OK; } iid = *piid; - nsAllocator::Free(piid); + nsMemory::Free(piid); } else iid = NS_GET_IID(nsISupports); @@ -833,7 +833,7 @@ CIDGetService::Call(JSContext *cx, JSObject *obj, nsCOMPtr srvc; rv = nsServiceManager::GetService(*cid, iid, getter_AddRefs(srvc), nsnull); - nsAllocator::Free(cid); + nsMemory::Free(cid); NS_ASSERTION(NS_FAILED(rv) || srvc, "service manager returned success, but service is null!"); if(NS_FAILED(rv) || !srvc) { diff --git a/mozilla/js/src/xpconnect/src/xpcprivate.h b/mozilla/js/src/xpconnect/src/xpcprivate.h index d1c0e8af62e..479ae68d2f1 100644 --- a/mozilla/js/src/xpconnect/src/xpcprivate.h +++ b/mozilla/js/src/xpconnect/src/xpcprivate.h @@ -47,7 +47,7 @@ #include "nsIComponentManager.h" #include "nsISupportsPrimitives.h" #include "nsIGenericFactory.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIXPConnect.h" #include "nsIInterfaceInfo.h" #include "nsIInterfaceInfoManager.h" @@ -116,7 +116,7 @@ extern const char XPC_ARG_FORMATTER_FORMAT_STR[]; // format string NS_ENSURE_ARG_POINTER(dest); \ char* result; \ if(src) \ - result = (char*) nsAllocator::Clone(src, \ + result = (char*) nsMemory::Clone(src, \ sizeof(char)*(strlen(src)+1)); \ else \ result = nsnull; \ diff --git a/mozilla/js/src/xpconnect/src/xpcstack.cpp b/mozilla/js/src/xpconnect/src/xpcstack.cpp index 2f0af6191db..a7b41c69ede 100644 --- a/mozilla/js/src/xpconnect/src/xpcstack.cpp +++ b/mozilla/js/src/xpconnect/src/xpcstack.cpp @@ -125,9 +125,9 @@ XPCJSStackFrame::XPCJSStackFrame() XPCJSStackFrame::~XPCJSStackFrame() { if(mFilename) - nsAllocator::Free(mFilename); + nsMemory::Free(mFilename); if(mFunname) - nsAllocator::Free(mFunname); + nsMemory::Free(mFunname); if(mCaller) NS_RELEASE(mCaller); } @@ -162,7 +162,7 @@ XPCJSStackFrame::CreateStack(JSContext* cx, JSStackFrame* fp) if(filename) { self->mFilename = (char*) - nsAllocator::Clone(filename, + nsMemory::Clone(filename, sizeof(char)*(strlen(filename)+1)); } @@ -176,7 +176,7 @@ XPCJSStackFrame::CreateStack(JSContext* cx, JSStackFrame* fp) if(funname) { self->mFunname = (char*) - nsAllocator::Clone(funname, + nsMemory::Clone(funname, sizeof(char)*(strlen(funname)+1)); } } @@ -218,7 +218,7 @@ XPCJSStackFrame::CreateStackFrameLocation(JSBool isJSFrame, if(!failed && aFilename) { self->mFilename = (char*) - nsAllocator::Clone(aFilename, + nsMemory::Clone(aFilename, sizeof(char)*(strlen(aFilename)+1)); if(!self->mFilename) failed = JS_TRUE; @@ -227,7 +227,7 @@ XPCJSStackFrame::CreateStackFrameLocation(JSBool isJSFrame, if(!failed && aFunctionName) { self->mFunname = (char*) - nsAllocator::Clone(aFunctionName, + nsMemory::Clone(aFunctionName, sizeof(char)*(strlen(aFunctionName)+1)); if(!self->mFunname) failed = JS_TRUE; @@ -304,7 +304,7 @@ NS_IMETHODIMP XPCJSStackFrame::ToString(char **_retval) (strlen(frametype) + strlen(filename) + strlen(funname)) + sizeof(format) + 6 /* space for lineno */; - char* buf = (char*) nsAllocator::Alloc(len); + char* buf = (char*) nsMemory::Alloc(len); if(!buf) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp b/mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp index 262d7253a87..5ad82783b65 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp @@ -314,7 +314,7 @@ nsXPCWrappedJS::GetIID(nsIID** iid) { NS_PRECONDITION(iid, "bad param"); - *iid = (nsIID*) nsAllocator::Clone(&(GetIID()), sizeof(nsIID)); + *iid = (nsIID*) nsMemory::Clone(&(GetIID()), sizeof(nsIID)); return *iid ? NS_OK : NS_ERROR_UNEXPECTED; } @@ -334,7 +334,7 @@ nsXPCWrappedJS::DebugDump(PRInt16 depth) GetClass()->GetInterfaceInfo()->GetName(&name); XPC_LOG_ALWAYS(("interface name is %s", name)); if(name) - nsAllocator::Free(name); + nsMemory::Free(name); char * iid = GetClass()->GetIID().ToString(); XPC_LOG_ALWAYS(("IID number is %s", iid)); delete iid; diff --git a/mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp b/mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp index 9f5cc47be2a..44e25e9632f 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp @@ -147,7 +147,7 @@ nsXPCWrappedJSClass::~nsXPCWrappedJSClass() mRuntime->GetWrappedJSClassMap()->Remove(this); } if(mName) - nsAllocator::Free(mName); + nsMemory::Free(mName); NS_IF_RELEASE(mInfo); } @@ -275,7 +275,7 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self, if(NS_SUCCEEDED(current->GetIID(&iid)) && iid) { PRBool found = aIID.Equals(*iid); - nsAllocator::Free(iid); + nsMemory::Free(iid); if(found) { *aInstancePtr = (void*) self; @@ -426,7 +426,7 @@ nsXPCWrappedJSClass::CleanupPointerArray(const nsXPTType& datum_type, for(JSUint32 k = 0; k < array_count; k++) { void* p = pp[k]; - if(p) nsAllocator::Free(p); + if(p) nsMemory::Free(p); } } } @@ -444,7 +444,7 @@ nsXPCWrappedJSClass::CleanupPointerTypeObject(const nsXPTType& type, else { void* p = *((void**)pp); - if(p) nsAllocator::Free(p); + if(p) nsMemory::Free(p); } } @@ -614,7 +614,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex, { if(iidIsOwned) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); iidIsOwned = JS_FALSE; } conditional_iid = nsnull; @@ -687,7 +687,7 @@ pre_call_clean_up: CleanupPointerArray(datum_type, array_count, pp); } // always release the array if it is inout - nsAllocator::Free(pp); + nsMemory::Free(pp); } } else @@ -700,7 +700,7 @@ pre_call_clean_up: { if(iidIsOwned) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); iidIsOwned = JS_FALSE; } conditional_iid = nsnull; @@ -816,7 +816,7 @@ pre_call_clean_up: { printf(text); printf("\n"); - nsAllocator::Free(text); + nsMemory::Free(text); } else printf(cant_get_text); @@ -906,7 +906,7 @@ pre_call_clean_up: { if(iidIsOwned) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); iidIsOwned = JS_FALSE; } conditional_iid = nsnull; @@ -1005,7 +1005,7 @@ pre_call_clean_up: { if(iidIsOwned) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); iidIsOwned = JS_FALSE; } conditional_iid = nsnull; @@ -1048,7 +1048,7 @@ pre_call_clean_up: { CleanupPointerArray(datum_type, array_count, pp); } - nsAllocator::Free(pp); + nsMemory::Free(pp); } } else @@ -1067,7 +1067,7 @@ done: js_FreeStack(cx, mark); if(conditional_iid && iidIsOwned) - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); if(cx) JS_SetErrorReporter(cx, older); @@ -1121,7 +1121,7 @@ nsXPCWrappedJSClass::DebugDump(PRInt16 depth) mInfo->GetName(&name); XPC_LOG_ALWAYS(("interface name is %s", name)); if(name) - nsAllocator::Free(name); + nsMemory::Free(name); char * iid = mIID.ToString(); XPC_LOG_ALWAYS(("IID number is %s", iid)); delete iid; diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp index e3a9811cf0a..f4dd2fd66b0 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp @@ -494,7 +494,7 @@ nsXPCWrappedNative::GetIID(nsIID** iid) { NS_PRECONDITION(iid, "bad param"); - *iid = (nsIID*) nsAllocator::Clone(&GetIID(), sizeof(nsIID)); + *iid = (nsIID*) nsMemory::Clone(&GetIID(), sizeof(nsIID)); return *iid ? NS_OK : NS_ERROR_UNEXPECTED; } diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednativeclass.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednativeclass.cpp index 60255212cff..f1cc91cc9c5 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednativeclass.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednativeclass.cpp @@ -170,7 +170,7 @@ nsXPCWrappedNativeClass::~nsXPCWrappedNativeClass() } DestroyMemberDescriptors(); if(mName) - nsAllocator::Free(mName); + nsMemory::Free(mName); NS_RELEASE(mInfo); } @@ -374,7 +374,7 @@ nsXPCWrappedNativeClass::HandlePossibleNameCaseError(JSContext* cx, jsid id) locationStr, badName, ifaceName, goodName); } if(locationStr) - nsAllocator::Free(locationStr); + nsMemory::Free(locationStr); } } } @@ -520,7 +520,7 @@ nsXPCWrappedNativeClass::GetInterfaceTypeFromParam( return JS_FALSE; } - if(!(*result = (nsID*) nsAllocator::Clone(dispatchParams[argnum].val.p, + if(!(*result = (nsID*) nsMemory::Clone(dispatchParams[argnum].val.p, sizeof(nsID)))) { JS_ReportOutOfMemory(cx); @@ -753,7 +753,7 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx, if(conditional_iid) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); conditional_iid = nsnull; } } @@ -898,7 +898,7 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx, if(conditional_iid) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); conditional_iid = nsnull; } } @@ -1023,7 +1023,7 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx, } if(conditional_iid) { - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); conditional_iid = nsnull; } } @@ -1062,7 +1062,7 @@ done: for(JSUint32 k = 0; k < array_count; k++) { void* o = a[k]; - if(o) nsAllocator::Free(o); + if(o) nsMemory::Free(o); } } else // if(dp->IsValInterface()) @@ -1076,17 +1076,17 @@ done: } } // always free the array itself - nsAllocator::Free(p); + nsMemory::Free(p); } else if(dp->IsValOwned()) - nsAllocator::Free(p); + nsMemory::Free(p); else if(dp->IsValInterface()) ((nsISupports*)p)->Release(); } } if(conditional_iid) - nsAllocator::Free((void*)conditional_iid); + nsMemory::Free((void*)conditional_iid); if(dispatchParams && dispatchParams != paramBuffer) delete [] dispatchParams; diff --git a/mozilla/js/src/xpconnect/tests/TestXPC.cpp b/mozilla/js/src/xpconnect/tests/TestXPC.cpp index b6c3f44870b..b66b695fd11 100644 --- a/mozilla/js/src/xpconnect/tests/TestXPC.cpp +++ b/mozilla/js/src/xpconnect/tests/TestXPC.cpp @@ -48,7 +48,7 @@ #include "nsIComponentManager.h" #include "nsIJSContextStack.h" #include "nsIJSRuntimeService.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIXPCSecurityManager.h" #include "nsICategoryManager.h" @@ -167,7 +167,7 @@ NS_IMETHODIMP nsTestXPCFoo::GetFoo(char * *aFoo) if(!aFoo) return NS_ERROR_NULL_POINTER; if(mFoo) - *aFoo = (char*) nsAllocator::Clone(mFoo, strlen(mFoo)+1); + *aFoo = (char*) nsMemory::Clone(mFoo, strlen(mFoo)+1); else *aFoo = NULL; return NS_OK; @@ -178,11 +178,11 @@ NS_IMETHODIMP nsTestXPCFoo::SetFoo(const char * aFoo) // printf("nsTestXPCFoo::Set called "); if(mFoo) { - nsAllocator::Free(mFoo); + nsMemory::Free(mFoo); mFoo = NULL; } if(aFoo) - mFoo = (char*) nsAllocator::Clone(aFoo, strlen(aFoo)+1); + mFoo = (char*) nsMemory::Clone(aFoo, strlen(aFoo)+1); return NS_OK; } @@ -198,7 +198,7 @@ nsTestXPCFoo::nsTestXPCFoo() nsTestXPCFoo::~nsTestXPCFoo() { if(mFoo) - nsAllocator::Free(mFoo); + nsMemory::Free(mFoo); } /***************************************************************************/ @@ -616,7 +616,7 @@ static void ShowXPCException() { printf(str); printf("\n"); - nsAllocator::Free(str); + nsMemory::Free(str); nsresult res; e->GetResult(&res); @@ -635,7 +635,7 @@ static void ShowXPCException() { printf(str2); printf("\n"); - nsAllocator::Free(str2); + nsMemory::Free(str2); } } } diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_array.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_array.cpp index fa12ba7e212..60175e299a6 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_array.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_array.cpp @@ -140,7 +140,7 @@ xpcarraytest::MultiplyEachItemInIntegerArrayAndAppend(PRInt32 val, PRUint32 *cou if(valueArray && count && 0 != (in_count = *count) && nsnull != (in = *valueArray)) { PRInt32* out = - (PRInt32*) nsAllocator::Alloc(in_count * 2 * sizeof(PRUint32)); + (PRInt32*) nsMemory::Alloc(in_count * 2 * sizeof(PRUint32)); if(!out) return NS_ERROR_OUT_OF_MEMORY; @@ -150,7 +150,7 @@ xpcarraytest::MultiplyEachItemInIntegerArrayAndAppend(PRInt32 val, PRUint32 *cou out[i*2] = in[i]; out[i*2+1] = in[i] * val; } - nsAllocator::Free(in); + nsMemory::Free(in); *valueArray = out; *count = in_count * 2; return NS_OK; @@ -182,16 +182,16 @@ xpcarraytest::CallEchoMethodOnEachInArray(nsIID * *uuid, PRUint32 *count, void * } // cleanup - nsAllocator::Free(*uuid); - nsAllocator::Free(*result); + nsMemory::Free(*uuid); + nsMemory::Free(*result); // set up to hand over array of 'this' - *uuid = (nsIID*) nsAllocator::Clone(&NS_GET_IID(nsIXPCTestArray), + *uuid = (nsIID*) nsMemory::Clone(&NS_GET_IID(nsIXPCTestArray), sizeof(nsIID)); nsISupports** outArray = (nsISupports**) - nsAllocator::Alloc(2 * sizeof(nsISupports*)); + nsMemory::Alloc(2 * sizeof(nsISupports*)); outArray[0] = outArray[1] = this; NS_ADDREF(this); @@ -222,7 +222,7 @@ xpcarraytest::CallEchoMethodOnEachInArray2(PRUint32 *count, nsIEcho ***result) } // cleanup - nsAllocator::Free(*result); + nsMemory::Free(*result); // setup return *count = 0; @@ -242,7 +242,7 @@ xpcarraytest::DoubleStringArray(PRUint32 *count, char ***valueArray) if(!count || !*count) return NS_OK; - char** outArray = (char**) nsAllocator::Alloc(*count * 2 * sizeof(char*)); + char** outArray = (char**) nsMemory::Alloc(*count * 2 * sizeof(char*)); if(!outArray) return NS_ERROR_OUT_OF_MEMORY; @@ -250,8 +250,8 @@ xpcarraytest::DoubleStringArray(PRUint32 *count, char ***valueArray) for(PRUint32 i = 0; i < *count; i++) { int len = strlen(p[i]); - outArray[i*2] = (char*)nsAllocator::Alloc(((len * 2)+1) * sizeof(char)); - outArray[(i*2)+1] = (char*)nsAllocator::Alloc(((len * 2)+1) * sizeof(char)); + outArray[i*2] = (char*)nsMemory::Alloc(((len * 2)+1) * sizeof(char)); + outArray[(i*2)+1] = (char*)nsMemory::Alloc(((len * 2)+1) * sizeof(char)); for(int k = 0; k < len; k++) { @@ -259,10 +259,10 @@ xpcarraytest::DoubleStringArray(PRUint32 *count, char ***valueArray) outArray[(i*2)+1][k*2] = outArray[(i*2)+1][(k*2)+1] = p[i][k]; } outArray[i*2][len*2] = outArray[(i*2)+1][len*2] = '\0'; - nsAllocator::Free(p[i]); + nsMemory::Free(p[i]); } - nsAllocator::Free(p); + nsMemory::Free(p); *valueArray = outArray; *count = *count * 2; return NS_OK; @@ -308,7 +308,7 @@ xpcarraytest::DoubleString(PRUint32 *count, char **str) if(!count || !*count) return NS_OK; - char* out = (char*) nsAllocator::Alloc(((*count * 2)+1) * sizeof(char)); + char* out = (char*) nsMemory::Alloc(((*count * 2)+1) * sizeof(char)); if(!out) return NS_ERROR_OUT_OF_MEMORY; @@ -316,7 +316,7 @@ xpcarraytest::DoubleString(PRUint32 *count, char **str) for(k = 0; k < *count; k++) out[k*2] = out[(k*2)+1] = (*str)[k]; out[k*2] = '\0'; - nsAllocator::Free(*str); + nsMemory::Free(*str); *str = out; *count = *count * 2; return NS_OK; @@ -332,12 +332,12 @@ xpcarraytest::GetStrings(PRUint32 *count, char ***str) if(mReceiver) return mReceiver->GetStrings(count, str); - char** out = (char**) nsAllocator::Alloc(scount * sizeof(char*)); + char** out = (char**) nsMemory::Alloc(scount * sizeof(char*)); if(!out) return NS_ERROR_OUT_OF_MEMORY; for(PRUint32 i = 0; i < scount; ++i) { - out[i] = (char*) nsAllocator::Clone(strings[i], strlen(strings[i])+1); + out[i] = (char*) nsMemory::Clone(strings[i], strlen(strings[i])+1); // failure unlikely, leakage foolishly tolerated in this test case if(!out[i]) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_attributes.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_attributes.cpp index 63dada11711..f9ab6b99d2c 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_attributes.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_attributes.cpp @@ -68,11 +68,11 @@ xpcTestObjectReadOnly :: xpcTestObjectReadOnly() { charProperty = 'X'; const char _id[] = "a68cc6a6-6552-11d3-82ef-0060b0eb596f"; - stringID = (char*) nsAllocator::Clone(_id, sizeof(char)*(strlen(_id)+1)); + stringID = (char*) nsMemory::Clone(_id, sizeof(char)*(strlen(_id)+1)); }; NS_IMETHODIMP xpcTestObjectReadOnly :: GetID(char **_retval) { - *_retval= (char*) nsAllocator::Clone(stringID, + *_retval= (char*) nsMemory::Clone(stringID, sizeof(char)*(strlen(stringID)+1)); return *_retval? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -82,7 +82,7 @@ NS_IMETHODIMP xpcTestObjectReadOnly :: GetStrReadOnly(char * *aStrReadOnly){ if(!aStrReadOnly) return NS_ERROR_NULL_POINTER; - *aStrReadOnly = (char*) nsAllocator::Clone(aStrReadOnly, + *aStrReadOnly = (char*) nsMemory::Clone(aStrReadOnly, sizeof(char)*(strlen(aString)+1)); return *aStrReadOnly ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -168,14 +168,14 @@ xpcTestObjectReadWrite :: xpcTestObjectReadWrite() { charProperty = 'X'; const char s[] = "XPConnect Read-Writable String"; - stringProperty = (char*) nsAllocator::Clone(s, + stringProperty = (char*) nsMemory::Clone(s, sizeof(char)*(strlen(s)+1)); }; NS_IMETHODIMP xpcTestObjectReadWrite :: GetStringProperty(char * *aStringProperty) { if(!aStringProperty) return NS_ERROR_NULL_POINTER; - *aStringProperty = (char*) nsAllocator::Clone(stringProperty, + *aStringProperty = (char*) nsMemory::Clone(stringProperty, sizeof(char)*(strlen(stringProperty)+1)); return *aStringProperty ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -269,7 +269,7 @@ NS_IMPL_ISUPPORTS2(xpcTestAttributes, nsIXPCTestObjectReadWrite, nsIXPCTestObjec NS_IMETHODIMP xpcTestAttributes ::GetName(char * *aString) { if(!aString) return NS_ERROR_NULL_POINTER; - *aString = (char*) nsAllocator::Clone(name, + *aString = (char*) nsMemory::Clone(name, sizeof(char)*(strlen(name)+1)); return *aString ? NS_OK : NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp index 4ecb699655b..7b64747dec8 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp @@ -106,7 +106,7 @@ NS_IMETHODIMP xpctestEcho::In2OutOneString(const char* input, char** output) char* p; int len; if(input && output && - (NULL != (p = (char*)nsAllocator::Alloc(len=strlen(input)+1)))) + (NULL != (p = (char*)nsMemory::Alloc(len=strlen(input)+1)))) { memcpy(p, input, len); *output = p; @@ -198,7 +198,7 @@ xpctestEcho::SharedString(const char **str) // to do non-shared we clone the string: char buf[] = "a static string"; int len; - *str = (char*)nsAllocator::Alloc(len=strlen(buf)+1); + *str = (char*)nsMemory::Alloc(len=strlen(buf)+1); memcpy(*str, buf, len); */ return NS_OK; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_in.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_in.cpp index 7636c50fce5..67f324db354 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_in.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_in.cpp @@ -102,7 +102,7 @@ NS_IMETHODIMP xpcTestIn :: EchoWchar(PRUnichar wc, PRUnichar *_retval) { }; NS_IMETHODIMP xpcTestIn :: EchoString(const PRUnichar *ws, char **_retval) { /* const char s[] = *ws; - **_retval= (char*) nsAllocator::Clone(s, + **_retval= (char*) nsMemory::Clone(s, sizeof(char)*(strlen(s)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; */ @@ -140,12 +140,12 @@ NS_IMETHODIMP xpcTestIn :: EchoPRUint64(PRUint64 i, PRUint64 *_retval) { *_retval = i; return NS_OK; }; -NS_IMETHODIMP xpcTestIn :: EchoVoidStar(void * vs, void * *_retval) { +NS_IMETHODIMP xpcTestIn :: EchoVoidPtr(void * vs, void * *_retval) { *_retval = vs; return NS_OK; }; -NS_IMETHODIMP xpcTestIn :: EchoCharStar(char * cs, char * *_retval) { +NS_IMETHODIMP xpcTestIn :: EchoCharPtr(char * cs, char * *_retval) { **_retval = *cs; return NS_OK; }; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_inout.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_inout.cpp index c1158e42605..f4f44fa11f1 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_inout.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_inout.cpp @@ -115,10 +115,10 @@ NS_IMETHODIMP xpcTestInOut :: EchoPRUint32_2(PRUint32 ii, PRUint32 *io){ NS_IMETHODIMP xpcTestInOut :: EchoPRUint64(PRUint64 ii, PRUint64 *io){ return NS_OK; }; -NS_IMETHODIMP xpcTestInOut :: EchoVoidStar(void * vsi, void * *vso){ +NS_IMETHODIMP xpcTestInOut :: EchoVoidPtr(void * vsi, void * *vso){ return NS_OK; }; -NS_IMETHODIMP xpcTestInOut :: EchoCharStar(char * csi, char * *cso){ +NS_IMETHODIMP xpcTestInOut :: EchoCharPtr(char * csi, char * *cso){ return NS_OK; }; /* diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_multiple.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_multiple.cpp index 3f834757001..d1b41f9ac2d 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_multiple.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_multiple.cpp @@ -57,7 +57,7 @@ xpcTestParentOne :: xpcTestParentOne() NS_IMETHODIMP xpcTestParentOne :: GetParentOneAttribute(char * *_retval) { char aString[] = "xpcTestParentOne attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -72,7 +72,7 @@ NS_IMETHODIMP xpcTestParentOne :: ParentOneMethod(char * *_retval) { char aString[] = "xpcTestParentOne method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -122,7 +122,7 @@ NS_IMETHODIMP xpcTestParentTwo :: GetParentTwoAttribute(char * *_retval) { char aString[] = "xpcTestParentTwo attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -138,7 +138,7 @@ NS_IMETHODIMP xpcTestParentTwo :: ParentTwoMethod(char **_retval) { char aString[] = "xpcTestParentTwo method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -193,7 +193,7 @@ NS_IMETHODIMP xpcTestChild2:: GetChildAttribute(char * *_retval) { char aString[] = "xpcTestChild2 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -209,7 +209,7 @@ NS_IMETHODIMP xpcTestChild2 ::ChildMethod(char **_retval) { char aString[] = "xpcTestChild2 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -219,7 +219,7 @@ NS_IMETHODIMP xpcTestChild2 :: GetParentOneAttribute(char * *_retval) { char aString[] = "xpcTestChild2 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -235,7 +235,7 @@ NS_IMETHODIMP xpcTestChild2 :: ParentOneMethod(char * *_retval) { char aString[] = "xpcTestChild2 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -244,7 +244,7 @@ NS_IMETHODIMP xpcTestChild2 :: GetParentTwoAttribute(char * *_retval) { char aString[] = "xpcTestChild2 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -259,7 +259,7 @@ xpcTestChild2 :: SetParentTwoAttribute(const char * aParentTwoAttribute) NS_IMETHODIMP xpcTestChild2 :: ParentTwoMethod(char **_retval) { char aString[] = "xpcTestChild2 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -316,7 +316,7 @@ NS_IMETHODIMP xpcTestChild3:: GetChildAttribute(char * *_retval) { char aString[] = "xpcTestChild3 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -332,7 +332,7 @@ NS_IMETHODIMP xpcTestChild3 ::ChildMethod(char **_retval) { const char aString[] = "xpcTestChild3 method"; - *_retval = (char*) nsAllocator::Clone((const char *)aString, + *_retval = (char*) nsMemory::Clone((const char *)aString, sizeof(char)*(strlen((const char *)aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -342,7 +342,7 @@ NS_IMETHODIMP xpcTestChild3 :: GetParentOneAttribute(char * *_retval) { const char aString[] = "xpcTestChild3 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -358,7 +358,7 @@ NS_IMETHODIMP xpcTestChild3 :: ParentOneMethod(char * *_retval) { char aString[] = "xpcTestChild3 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -413,7 +413,7 @@ NS_IMETHODIMP xpcTestChild4:: GetChildAttribute(char * *_retval) { char aString[] = "xpcTestChild4 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -429,7 +429,7 @@ NS_IMETHODIMP xpcTestChild4 ::ChildMethod(char **_retval) { char aString[] = "xpcTestChild4 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -484,7 +484,7 @@ NS_IMETHODIMP xpcTestChild5:: GetChildAttribute(char * *_retval) { char aString[] = "xpcTestChild5 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -500,7 +500,7 @@ NS_IMETHODIMP xpcTestChild5 ::ChildMethod(char **_retval) { char aString[] = "xpcTestChild5 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -510,7 +510,7 @@ NS_IMETHODIMP xpcTestChild5 :: GetParentOneAttribute(char * *_retval) { char aString[] = "xpcTestChild5 attribute"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; @@ -526,7 +526,7 @@ NS_IMETHODIMP xpcTestChild5 :: ParentOneMethod(char * *_retval) { char aString[] = "xpcTestChild5 method"; - *_retval = (char*) nsAllocator::Clone(aString, + *_retval = (char*) nsMemory::Clone(aString, sizeof(char)*(strlen(aString)+1)); return **_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_out.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_out.cpp index 8029817ff0c..377bb9bd63c 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_out.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_out.cpp @@ -174,7 +174,7 @@ NS_IMETHODIMP xpcTestOut :: GetString(PRUnichar **ws){ if(!stringProperty) return NS_ERROR_NULL_POINTER; - *ws = (PRUnichar *) nsAllocator::Clone(stringProperty, + *ws = (PRUnichar *) nsMemory::Clone(stringProperty, sizeof(char) *(strlen(stringProperty)+1)); return **ws? NS_OK : NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_private.h b/mozilla/js/src/xpconnect/tests/components/xpctest_private.h index 380edf6d561..29864fc077c 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_private.h +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_private.h @@ -40,7 +40,7 @@ #include "nsISupports.h" #include "nsIFactory.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIXPConnect.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_string.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_string.cpp index 76143a7d89c..2a05a223062 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_string.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_string.cpp @@ -68,7 +68,7 @@ xpcstringtest::GetStringA(char **_retval) if(!_retval) return NS_ERROR_NULL_POINTER; - *_retval = (char*) nsAllocator::Clone(myResult, + *_retval = (char*) nsMemory::Clone(myResult, sizeof(char)*(strlen(myResult)+1)); return *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -82,7 +82,7 @@ xpcstringtest::GetStringB(char **s) if(!s) return NS_ERROR_NULL_POINTER; - *s = (char*) nsAllocator::Clone(myResult, + *s = (char*) nsMemory::Clone(myResult, sizeof(char)*(strlen(myResult)+1)); return *s ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -111,7 +111,7 @@ static PRUnichar* GetTestWString(int* size) if(!sWStr) { - sWStr = (PRUnichar*) nsAllocator::Alloc(space); + sWStr = (PRUnichar*) nsMemory::Alloc(space); if(sWStr) { PRUnichar* p = sWStr; @@ -137,7 +137,7 @@ NS_IMETHODIMP xpcstringtest::GetWStringCopied(PRUnichar **s) if(!str) return NS_ERROR_OUT_OF_MEMORY; - *s = (PRUnichar*) nsAllocator::Clone(str, size); + *s = (PRUnichar*) nsMemory::Clone(str, size); return *s ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/js/src/xpconnect/tests/idl/xpctest.idl b/mozilla/js/src/xpconnect/tests/idl/xpctest.idl index 9250cd461de..6dbdcc0749c 100644 --- a/mozilla/js/src/xpconnect/tests/idl/xpctest.idl +++ b/mozilla/js/src/xpconnect/tests/idl/xpctest.idl @@ -101,7 +101,7 @@ interface nsIEcho : nsISupports { inout string p15, inout wstring p16); - [noscript] void MethodWithNative(in long p1, in voidStar p2); + [noscript] void MethodWithNative(in long p1, in voidPtr p2); void ReturnCode(in long code); void FailInJSTest(in long fail); void SharedString([retval, shared] out string str); diff --git a/mozilla/js/src/xpconnect/tests/idl/xpctest_in.idl b/mozilla/js/src/xpconnect/tests/idl/xpctest_in.idl index 46cd957735d..a6d77a5b76f 100644 --- a/mozilla/js/src/xpconnect/tests/idl/xpctest_in.idl +++ b/mozilla/js/src/xpconnect/tests/idl/xpctest_in.idl @@ -67,8 +67,8 @@ interface nsIXPCTestIn : nsISupports { // native types must be marked noscript or they break the idl // compiler - [noscript] voidStar EchoVoidStar( in voidStar vs ); - [noscript] charStar EchoCharStar( in charStar cs ); + [noscript] voidPtr EchoVoidPtr( in voidPtr vs ); + [noscript] charPtr EchoCharPtr( in charPtr cs ); /* [noscript] voidRef EchoVoidRef( in voidRef vf ); [noscript] nsIDRef EchoNsIDRef( in nsIDRef r ); diff --git a/mozilla/js/src/xpconnect/tests/idl/xpctest_inout.idl b/mozilla/js/src/xpconnect/tests/idl/xpctest_inout.idl index 73c178bde1e..c5cc0fc65c2 100644 --- a/mozilla/js/src/xpconnect/tests/idl/xpctest_inout.idl +++ b/mozilla/js/src/xpconnect/tests/idl/xpctest_inout.idl @@ -66,8 +66,8 @@ interface nsIXPCTestInOut : nsISupports { // native types must be marked noscript or they break the idl // compiler - [noscript] void EchoVoidStar( in voidStar vsi, out voidStar vso ); - [noscript] void EchoCharStar( in charStar csi, out charStar cso ); + [noscript] void EchoVoidPtr( in voidPtr vsi, out voidPtr vso ); + [noscript] void EchoCharPtr( in charPtr csi, out charPtr cso ); //[noscript] void EchoVoidRef( in voidRef vfi, out voidRef vfo ); //[noscript] void EchoNsIDRef( in nsIDRef ri, out nsIDRef ro ); //[noscript] void EchoNsCIDRef( in nsCIDRef ri, out nsCIDRef ro ); diff --git a/mozilla/js/src/xpconnect/tools/src/nsXPCToolsCompiler.cpp b/mozilla/js/src/xpconnect/tools/src/nsXPCToolsCompiler.cpp index 5d27685be3e..c62e9a184e1 100644 --- a/mozilla/js/src/xpconnect/tools/src/nsXPCToolsCompiler.cpp +++ b/mozilla/js/src/xpconnect/tools/src/nsXPCToolsCompiler.cpp @@ -155,6 +155,6 @@ NS_IMETHODIMP nsXPCToolsCompiler::CompileFile(nsILocalFile *aFile, PRBool strict JS_SetOptions(cx, oldoptions); if(path) - nsAllocator::Free(path); + nsMemory::Free(path); return NS_OK; } diff --git a/mozilla/js/src/xpconnect/tools/src/xpctools_private.h b/mozilla/js/src/xpconnect/tools/src/xpctools_private.h index 6a31e59fae0..0696048448d 100644 --- a/mozilla/js/src/xpconnect/tools/src/xpctools_private.h +++ b/mozilla/js/src/xpconnect/tools/src/xpctools_private.h @@ -45,7 +45,7 @@ #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsIGenericFactory.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIXPConnect.h" #include "nsCOMPtr.h" #include "nsIModule.h" @@ -154,4 +154,4 @@ public: }; -#endif /* xpctoolsprivate_h___ */ \ No newline at end of file +#endif /* xpctoolsprivate_h___ */ diff --git a/mozilla/layout/base/nsAutoCopy.cpp b/mozilla/layout/base/nsAutoCopy.cpp index 8eb2d2ca2fe..7d351987527 100644 --- a/mozilla/layout/base/nsAutoCopy.cpp +++ b/mozilla/layout/base/nsAutoCopy.cpp @@ -185,7 +185,7 @@ nsAutoCopyService::NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection char *selStr = str.ToNewCString(); fprintf(stderr, "SELECTION: %s, %p, %p [%s]\n", reasons[reason], doc, aSel, selStr); - nsAllocator::Free(selStr); + nsMemory::Free(selStr); #endif return NS_OK; } diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index 0b2aacdc3b7..92b083c5780 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -163,7 +163,7 @@ nsPresContext::GetFontPreferences() mPrefs->CopyCharPref("font.default", &value); if (value) { mDefaultFont.name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } if (mLanguage) { @@ -205,7 +205,7 @@ nsPresContext::GetFontPreferences() mDefaultFixedFont.size = NSFloatPixelsToTwips((float) fixedSize, p2t); } if (unit != defaultUnit) { - nsAllocator::Free(unit); + nsMemory::Free(unit); unit = nsnull; } } diff --git a/mozilla/layout/base/nsPresState.cpp b/mozilla/layout/base/nsPresState.cpp index 3f3d8923216..411ad3c6cc4 100644 --- a/mozilla/layout/base/nsPresState.cpp +++ b/mozilla/layout/base/nsPresState.cpp @@ -68,7 +68,7 @@ nsPresState::GetStateProperty(const nsString& aName, nsString& aResult) PRUnichar* data; str->GetData(&data); aResult = data; - nsAllocator::Free(data); + nsMemory::Free(data); } else { aResult.SetLength(0); } @@ -90,7 +90,7 @@ nsPresState::SetStateProperty(const nsString& aName, const nsString& aValue) PRUnichar* val = aValue.ToNewUnicode(); supportsStr->SetData(val); - nsAllocator::Free(val); + nsMemory::Free(val); mPropertyTable->Put(&key, supportsStr); return NS_OK; } diff --git a/mozilla/layout/base/public/nsContentPolicyUtils.h b/mozilla/layout/base/public/nsContentPolicyUtils.h index 99b5d71456d..3ef2c78ec07 100644 --- a/mozilla/layout/base/public/nsContentPolicyUtils.h +++ b/mozilla/layout/base/public/nsContentPolicyUtils.h @@ -25,7 +25,7 @@ #include "nsString.h" #include "nsIContentPolicy.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIServiceManager.h" #ifndef __nsContentPolicyUtils_h__ diff --git a/mozilla/layout/base/src/nsAutoCopy.cpp b/mozilla/layout/base/src/nsAutoCopy.cpp index 8eb2d2ca2fe..7d351987527 100644 --- a/mozilla/layout/base/src/nsAutoCopy.cpp +++ b/mozilla/layout/base/src/nsAutoCopy.cpp @@ -185,7 +185,7 @@ nsAutoCopyService::NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection char *selStr = str.ToNewCString(); fprintf(stderr, "SELECTION: %s, %p, %p [%s]\n", reasons[reason], doc, aSel, selStr); - nsAllocator::Free(selStr); + nsMemory::Free(selStr); #endif return NS_OK; } diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index b3eefe728d3..bacdf390654 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -3508,7 +3508,7 @@ nsDocument::SaveFile(nsFileSpec* aFileSpec, // Get a document encoder instance: nsCOMPtr encoder; - char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + char* progid = (char *)nsMemory::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp index 0b2aacdc3b7..92b083c5780 100644 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ b/mozilla/layout/base/src/nsPresContext.cpp @@ -163,7 +163,7 @@ nsPresContext::GetFontPreferences() mPrefs->CopyCharPref("font.default", &value); if (value) { mDefaultFont.name.AssignWithConversion(value); - nsAllocator::Free(value); + nsMemory::Free(value); value = nsnull; } if (mLanguage) { @@ -205,7 +205,7 @@ nsPresContext::GetFontPreferences() mDefaultFixedFont.size = NSFloatPixelsToTwips((float) fixedSize, p2t); } if (unit != defaultUnit) { - nsAllocator::Free(unit); + nsMemory::Free(unit); unit = nsnull; } } diff --git a/mozilla/layout/base/src/nsPresState.cpp b/mozilla/layout/base/src/nsPresState.cpp index 3f3d8923216..411ad3c6cc4 100644 --- a/mozilla/layout/base/src/nsPresState.cpp +++ b/mozilla/layout/base/src/nsPresState.cpp @@ -68,7 +68,7 @@ nsPresState::GetStateProperty(const nsString& aName, nsString& aResult) PRUnichar* data; str->GetData(&data); aResult = data; - nsAllocator::Free(data); + nsMemory::Free(data); } else { aResult.SetLength(0); } @@ -90,7 +90,7 @@ nsPresState::SetStateProperty(const nsString& aName, const nsString& aValue) PRUnichar* val = aValue.ToNewUnicode(); supportsStr->SetData(val); - nsAllocator::Free(val); + nsMemory::Free(val); mPropertyTable->Put(&key, supportsStr); return NS_OK; } diff --git a/mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp b/mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp index 3f9ad8d16ef..57e6faaf331 100644 --- a/mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp @@ -37,7 +37,7 @@ #include "nsLayoutAtoms.h" #include "nsObjectFrame.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "xptinfo.h" #include "nsIInterfaceInfoManager.h" #include "nsIPluginInstance.h" @@ -337,7 +337,7 @@ nsHTMLEmbedElement::GetProperty(JSContext *aContext, JSObject *aObj, jsval aID, retval = PR_TRUE; } } - nsAllocator::Free(iid); + nsMemory::Free(iid); return retval; } } diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 0c1c4f1b721..3b67028f8c2 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -4050,7 +4050,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) uri = baseURI; } else { rv = NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI); - nsAllocator::Free(uriAttrib); + nsMemory::Free(uriAttrib); } if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/layout/html/forms/src/nsFormFrame.cpp b/mozilla/layout/html/forms/src/nsFormFrame.cpp index b659b42422d..40b19ea018c 100644 --- a/mozilla/layout/html/forms/src/nsFormFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormFrame.cpp @@ -956,7 +956,7 @@ nsFormFrame::URLEncode(const nsString& aString, nsIUnicodeEncoder* encoder) nsString* result = new nsString; result->AssignWithConversion(outBuf); nsCRT::free(outBuf); - nsAllocator::Free(convertedBuf); + nsMemory::Free(convertedBuf); return result; } @@ -1332,7 +1332,7 @@ nsresult nsFormFrame::ProcessAsMultipart(nsIFormProcessor* aFormProcessor,nsIFil contentLen += PL_strlen(value) + crlfLen; } delete [] name; - nsAllocator::Free(value); + nsMemory::Free(value); } delete [] names; delete [] values; @@ -1481,7 +1481,7 @@ nsresult nsFormFrame::ProcessAsMultipart(nsIFormProcessor* aFormProcessor,nsIFil if (NS_FAILED(rv) || (wantbytes != gotbytes)) break; } delete [] name; - nsAllocator::Free(value); + nsMemory::Free(value); } delete [] names; delete [] values; diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp index e3892c2582e..3031d225990 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp @@ -2007,7 +2007,7 @@ CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *aRule) sel->mAttr->ToString(str); char * chars = str.ToNewCString(); fprintf(stderr, "[%s@%p]", chars, this); - nsAllocator::Free(chars); + nsMemory::Free(chars); #endif AtomKey key(sel->mAttr); mInner->mRelevantAttributes.Put(&key, sel->mAttr); diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index e3892c2582e..3031d225990 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -2007,7 +2007,7 @@ CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *aRule) sel->mAttr->ToString(str); char * chars = str.ToNewCString(); fprintf(stderr, "[%s@%p]", chars, this); - nsAllocator::Free(chars); + nsMemory::Free(chars); #endif AtomKey key(sel->mAttr); mInner->mRelevantAttributes.Put(&key, sel->mAttr); diff --git a/mozilla/layout/xbl/src/nsXBLBinding.cpp b/mozilla/layout/xbl/src/nsXBLBinding.cpp index bb7b5610c44..83b4aa72138 100644 --- a/mozilla/layout/xbl/src/nsXBLBinding.cpp +++ b/mozilla/layout/xbl/src/nsXBLBinding.cpp @@ -819,7 +819,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) &myFunc); } for (PRUint32 l = 0; l < argCount; l++) { - nsAllocator::Free(args[l]); + nsMemory::Free(args[l]); } } else if (tagName.get() == kPropertyAtom) { @@ -1328,7 +1328,7 @@ nsXBLBinding::BuildInsertionTable() token = nsCRT::strtok( newStr, ", ", &newStr ); } - nsAllocator::Free(str); + nsMemory::Free(str); } } } @@ -1455,7 +1455,7 @@ nsXBLBinding::ConstructAttributeTable(nsIContent* aElement) token = nsCRT::strtok( newStr, ", ", &newStr ); } - nsAllocator::Free(str); + nsMemory::Free(str); } // Recur into our children. diff --git a/mozilla/layout/xbl/src/nsXBLService.cpp b/mozilla/layout/xbl/src/nsXBLService.cpp index 569b5b6a3df..3fd791b38ab 100644 --- a/mozilla/layout/xbl/src/nsXBLService.cpp +++ b/mozilla/layout/xbl/src/nsXBLService.cpp @@ -178,7 +178,7 @@ nsXBLService::nsXBLService(void) static PRBool PR_CALLBACK DeleteClasses(nsHashKey* aKey, void* aValue, void* closure) { JSClass* c = (JSClass*)aValue; - nsAllocator::Free(c->name); + nsMemory::Free(c->name); delete c; return PR_TRUE; } diff --git a/mozilla/layout/xul/base/src/nsToolbarFrame.cpp b/mozilla/layout/xul/base/src/nsToolbarFrame.cpp index 85a6469ca1a..a6a433d2af9 100644 --- a/mozilla/layout/xul/base/src/nsToolbarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsToolbarFrame.cpp @@ -380,7 +380,7 @@ nsToolbarFrame :: AttributeChanged ( nsIPresContext* aPresContext, nsIContent* a aChild->GetAttribute ( kNameSpaceID_None, aAttribute, attribute ); char* iHateNSString = attribute.ToNewCString(); mXDropLoc = atoi( iHateNSString ); - nsAllocator::Free ( iHateNSString ); + nsMemory::Free ( iHateNSString ); } else rv = nsBoxFrame::AttributeChanged ( aPresContext, aChild, aNameSpaceID, aAttribute, aHint ); diff --git a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp index 685a5e36943..ec755b22683 100644 --- a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp @@ -271,7 +271,7 @@ nsToolboxFrame::DragDrop(nsIDOMEvent* aMouseEvent) dragSession->SetCanDrop(PR_TRUE); } - nsAllocator::Free ( whichFlavor ); + nsMemory::Free ( whichFlavor ); } } // foreach drag item } diff --git a/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp b/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp index ec369e215c6..183116e64d7 100644 --- a/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbCardProperty.cpp @@ -388,7 +388,7 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich nsAutoString cardValue(value); char* valueStr = cardValue.ToNewCString(); rv = SetAnonymousStringAttribute(attrname, valueStr); - nsAllocator::Free(valueStr); + nsMemory::Free(valueStr); } return rv; } @@ -1270,8 +1270,8 @@ static const char *kAbPrintUrlFormat = "addbook:printone?email=%s&folder=%s"; *aPrintCardUrl = PR_smprintf(kAbPrintUrlFormat, emailCharStr, dirCharStr); - nsAllocator::Free(emailCharStr); - nsAllocator::Free(dirCharStr); + nsMemory::Free(emailCharStr); + nsMemory::Free(dirCharStr); PR_FREEIF(dirName); PR_FREEIF(email); diff --git a/mozilla/mailnews/addrbook/src/nsAbDirectory.cpp b/mozilla/mailnews/addrbook/src/nsAbDirectory.cpp index 6979323dd53..de7a38341b2 100644 --- a/mozilla/mailnews/addrbook/src/nsAbDirectory.cpp +++ b/mozilla/mailnews/addrbook/src/nsAbDirectory.cpp @@ -153,7 +153,7 @@ NS_IMETHODIMP nsAbDirectory::OnListEntryChange nsCOMPtr res; rv = rdf->GetResource(listURI, getter_AddRefs(res)); if(listURI) - nsAllocator::Free(listURI); + nsMemory::Free(listURI); if (NS_SUCCEEDED(rv)) { nsCOMPtr listDir = do_QueryInterface(res); @@ -413,7 +413,7 @@ NS_IMETHODIMP nsAbDirectory::AddChildCards(const char *uriName, nsIAbCard **chil return rv; } } - nsAllocator::Free(uriStr); + nsMemory::Free(uriStr); *childCard = personCard; NS_ADDREF(*childCard); @@ -585,7 +585,7 @@ NS_IMETHODIMP nsAbDirectory::DeleteDirectory(nsIAbDirectory *directory) if (NS_SUCCEEDED(rv)) { rv = addresBook->GetAbDatabaseFromURI(uri, getter_AddRefs(database)); - nsAllocator::Free(uri); + nsMemory::Free(uri); if (NS_SUCCEEDED(rv)) rv = database->DeleteMailList(directory, PR_TRUE); @@ -640,7 +640,7 @@ NS_IMETHODIMP nsAbDirectory::HasDirectory(nsIAbDirectory *dir, PRBool *hasDir) if (NS_SUCCEEDED(rv)) { rv = addresBook->GetAbDatabaseFromURI(uri, getter_AddRefs(database)); - nsAllocator::Free(uri); + nsMemory::Free(uri); } if(NS_SUCCEEDED(rv) && database) { diff --git a/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp b/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp index ad8dc93c504..a3ecf248a6b 100644 --- a/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp +++ b/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp @@ -2788,7 +2788,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetFirstName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2798,7 +2798,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetLastName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2808,7 +2808,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetDisplayName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2818,7 +2818,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetNickName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2828,7 +2828,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetPrimaryEmail(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2838,7 +2838,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetSecondEmail(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2853,7 +2853,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkPhone(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2863,7 +2863,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomePhone(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2873,7 +2873,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetFaxNumber(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2883,7 +2883,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetPagerNumber(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2893,7 +2893,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCellularNumber(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2903,7 +2903,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeAddress(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2913,7 +2913,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeAddress2(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2923,7 +2923,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeCity(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2933,7 +2933,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeState(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2943,7 +2943,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeZipCode(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2953,7 +2953,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetHomeCountry(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2963,7 +2963,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkAddress(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2973,7 +2973,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkAddress2(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2983,7 +2983,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkCity(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -2993,7 +2993,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkState(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3003,7 +3003,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkZipCode(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3013,7 +3013,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWorkCountry(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3023,7 +3023,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetJobTitle(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3033,7 +3033,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetDepartment(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3043,7 +3043,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCompany(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3053,7 +3053,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWebPage1(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3063,7 +3063,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetWebPage2(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3073,7 +3073,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetBirthYear(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3083,7 +3083,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetBirthMonth(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3093,7 +3093,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetBirthDay(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3103,7 +3103,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCustom1(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3113,7 +3113,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCustom2(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3123,7 +3123,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCustom3(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3133,7 +3133,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetCustom4(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } @@ -3143,7 +3143,7 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow) tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newCard->SetNotes(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } PRUint32 key = 0; @@ -3172,7 +3172,7 @@ nsresult nsAddrDatabase::GetListCardFromDB(nsIAbCard *listCard, nsIMdbRow* cardR INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); listCard->SetDisplayName(unicodeStr); listCard->SetLastName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } err = GetStringColumn(cardRow, m_ListNickNameColumnToken, tempString); @@ -3181,7 +3181,7 @@ nsresult nsAddrDatabase::GetListCardFromDB(nsIAbCard *listCard, nsIMdbRow* cardR tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); listCard->SetNickName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } err = GetStringColumn(cardRow, m_ListDescriptionColumnToken, tempString); @@ -3190,7 +3190,7 @@ nsresult nsAddrDatabase::GetListCardFromDB(nsIAbCard *listCard, nsIMdbRow* cardR tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); listCard->SetNotes(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } PRUint32 key = 0; @@ -3217,7 +3217,7 @@ nsresult nsAddrDatabase::GetListFromDB(nsIAbDirectory *newList, nsIMdbRow* listR tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newList->SetListName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } err = GetStringColumn(listRow, m_ListNickNameColumnToken, tempString); @@ -3226,7 +3226,7 @@ nsresult nsAddrDatabase::GetListFromDB(nsIAbDirectory *newList, nsIMdbRow* listR tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newList->SetListNickName(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } err = GetStringColumn(listRow, m_ListDescriptionColumnToken, tempString); @@ -3235,7 +3235,7 @@ nsresult nsAddrDatabase::GetListFromDB(nsIAbDirectory *newList, nsIMdbRow* listR tempCString = tempString.ToNewCString(); INTL_ConvertToUnicode((const char *)tempCString, nsCRT::strlen(tempCString), (void**)&unicodeStr, &unicharLength); newList->SetDescription(unicodeStr); - nsAllocator::Free(tempCString); + nsMemory::Free(tempCString); PR_Free(unicodeStr); } diff --git a/mozilla/mailnews/addrbook/src/nsCardDataSource.cpp b/mozilla/mailnews/addrbook/src/nsCardDataSource.cpp index 01f1d0ed5f9..e1c7c7359aa 100644 --- a/mozilla/mailnews/addrbook/src/nsCardDataSource.cpp +++ b/mozilla/mailnews/addrbook/src/nsCardDataSource.cpp @@ -654,7 +654,7 @@ nsresult nsAbCardDataSource::DoNewCard(nsIAbCard *card, nsISupportsArray *argume PRUnichar *name; literal->GetValue(&name); nsString tempStr = name; - nsAllocator::Free(name); + nsMemory::Free(name); nsCAutoString nameStr; nameStr.AssignWithConversion(tempStr); // rv = card->CreateNewCard(nameStr); diff --git a/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp b/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp index ad31f3bcbf2..f4e8b5d78a0 100644 --- a/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp +++ b/mozilla/mailnews/addrbook/src/nsDirectoryDataSource.cpp @@ -537,7 +537,7 @@ nsresult nsAbDirectoryDataSource::createDirectoryUriNode(nsIAbDirectory *directo if (NS_FAILED(rv)) return rv; nsString nameString; nameString.AssignWithConversion(uri); createNode(nameString, target); - nsAllocator::Free(uri); + nsMemory::Free(uri); return NS_OK; } @@ -645,7 +645,7 @@ nsresult nsAbDirectoryDataSource::DoNewDirectory(nsIAbDirectory *directory, nsIS literal->GetValue(&name); rv = directory->CreateNewDirectory(name, nsnull, PR_FALSE /* migrating */); - nsAllocator::Free(name); + nsMemory::Free(name); } return rv; } diff --git a/mozilla/mailnews/base/public/nsIMsgGroupRecord.idl b/mozilla/mailnews/base/public/nsIMsgGroupRecord.idl index c4e8fb70517..633023511a9 100644 --- a/mozilla/mailnews/base/public/nsIMsgGroupRecord.idl +++ b/mozilla/mailnews/base/public/nsIMsgGroupRecord.idl @@ -26,10 +26,10 @@ [scriptable, uuid(4ed03c60-b256-11d2-b7f0-00805f05ffa5)] interface nsIMsgGroupRecord : nsISupports { - /* making this a voidStar is really ugly, but it's a quick + /* making this a voidPtr is really ugly, but it's a quick * solution right now */ - [noscript] void Init(in voidStar parent, + [noscript] void Init(in voidPtr parent, in string partname, in long long time, in long uniqueid, diff --git a/mozilla/mailnews/base/search/public/nsIMsgSearchSession.idl b/mozilla/mailnews/base/search/public/nsIMsgSearchSession.idl index 984163a9319..c57411449a8 100644 --- a/mozilla/mailnews/base/search/public/nsIMsgSearchSession.idl +++ b/mozilla/mailnews/base/search/public/nsIMsgSearchSession.idl @@ -68,7 +68,7 @@ interface nsIMsgSearchSession : nsISupports { custom header dialog if custom headers are not supported */ [noscript] boolean ScopeUsesCustomHeaders(in nsMsgSearchScopeValue scope, /* could be a folder or server based on scope */ - in voidStar selection, + in voidPtr selection, in boolean forFilters); /* use this to determine if your attribute is a string attrib */ @@ -80,11 +80,11 @@ interface nsIMsgSearchSession : nsISupports { void Search(in nsIMsgWindow aWindow); void InterruptSearch(); - [noscript] readonly attribute voidStar searchParam; + [noscript] readonly attribute voidPtr searchParam; readonly attribute nsMsgSearchType searchType; [noscript] nsMsgSearchType SetSearchParam(in nsMsgSearchType type, - in voidStar param); + in voidPtr param); [noscript] void AddResultElement(in nsMsgResultElement element); diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp index 832843c5b01..ba88552c771 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchAdapter.cpp @@ -862,7 +862,7 @@ nsMsgSearchValidityTable::GetAvailableAttributes(PRUint32 *length, } nsMsgSearchAttribValue *array = (nsMsgSearchAttribValue*) - nsAllocator::Alloc(sizeof(nsMsgSearchAttribValue) * totalAttributes); + nsMemory::Alloc(sizeof(nsMsgSearchAttribValue) * totalAttributes); NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY); PRUint32 numStored=0; @@ -895,7 +895,7 @@ nsMsgSearchValidityTable::GetAvailableOperators(nsMsgSearchAttribValue aAttribut } nsMsgSearchOpValue *array = (nsMsgSearchOpValue*) - nsAllocator::Alloc(sizeof(nsMsgSearchOpValue) * totalOperators); + nsMemory::Alloc(sizeof(nsMsgSearchOpValue) * totalOperators); NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY); PRUint32 numStored = 0; diff --git a/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp b/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp index 4763b0e7e22..e44fd64142e 100644 --- a/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp +++ b/mozilla/mailnews/base/src/nsCopyMessageStreamListener.cpp @@ -71,7 +71,7 @@ static nsresult GetMessage(nsIURI *aURL, nsIMessage **message) messageResource->QueryInterface(NS_GET_IID(nsIMessage), (void**)message); } } - nsAllocator::Free(uri); + nsMemory::Free(uri); return rv; } diff --git a/mozilla/mailnews/base/src/nsMsgFolderDataSource.cpp b/mozilla/mailnews/base/src/nsMsgFolderDataSource.cpp index 2bdda3229ec..d26858ac26b 100644 --- a/mozilla/mailnews/base/src/nsMsgFolderDataSource.cpp +++ b/mozilla/mailnews/base/src/nsMsgFolderDataSource.cpp @@ -1494,7 +1494,7 @@ nsresult nsMsgFolderDataSource::DoFolderAssert(nsIMsgFolder *folder, nsIRDFResou if(NS_SUCCEEDED(rv)) { rv = folder->SetCharset(value); - nsAllocator::Free(value); + nsMemory::Free(value); } } else diff --git a/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp b/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp index c132be77b24..876c9e2eecc 100644 --- a/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp +++ b/mozilla/mailnews/base/src/nsMsgNotificationManager.cpp @@ -28,7 +28,7 @@ #include "nsIMsgMailSession.h" #include "nsMsgBaseCID.h" #include "MailNewsTypes.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsXPIDLString.h" static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); @@ -293,7 +293,7 @@ nsresult nsMsgNotificationManager::AddNewMailNotification(nsIMsgFolder *folder) if(NS_SUCCEEDED(rv) && folderDescription) { sourceString = folderDescription; - nsAllocator::Free(folderDescription); + nsMemory::Free(folderDescription); } rv = rdfService->GetLiteral(sourceString.GetUnicode(), getter_AddRefs(source)); if(NS_SUCCEEDED(rv)) @@ -417,6 +417,6 @@ nsresult nsMsgNotificationManager::BuildNewMailURI(nsIMsgFolder *folder, nsCAuto newMailURI = "newmail:"; newMailURI += folderURI; - nsAllocator::Free(folderURI); + nsMemory::Free(folderURI); return NS_OK; } diff --git a/mozilla/mailnews/base/src/nsMsgRDFUtils.cpp b/mozilla/mailnews/base/src/nsMsgRDFUtils.cpp index 91bc7bf1603..d693e981e1b 100644 --- a/mozilla/mailnews/base/src/nsMsgRDFUtils.cpp +++ b/mozilla/mailnews/base/src/nsMsgRDFUtils.cpp @@ -23,7 +23,7 @@ #include "nsIServiceManager.h" #include "prprf.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" @@ -40,8 +40,8 @@ peqWithParameter(nsIRDFResource *r1, nsIRDFResource *r2, const char *parameter) r2nsStr.AssignWithConversion(r2Str); r1nsStr.AssignWithConversion(r1Str); - nsAllocator::Free(r2Str); - nsAllocator::Free(r1Str); + nsMemory::Free(r2Str); + nsMemory::Free(r1Str); //Look to see if there are any parameters PRInt32 paramStart = r2nsStr.FindChar('?'); @@ -138,7 +138,7 @@ nsresult createNode(const char* charstr, nsIRDFNode **node, nsIRDFService *rdfSe *node = value; NS_IF_ADDREF(*node); } - nsAllocator::Free(ucharstr); + nsMemory::Free(ucharstr); } return rv; } diff --git a/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp b/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp index 4712b8ddc54..26e6d6928a8 100644 --- a/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp +++ b/mozilla/mailnews/base/util/nsLocalFolderSummarySpec.cpp @@ -76,7 +76,7 @@ void nsLocalFolderSummarySpec:: CreateSummaryFileName() fullLeafName.AppendWithConversion(".msf"); // message summary file char *cLeafName = fullLeafName.ToNewCString(); SetLeafName(cLeafName); - nsAllocator::Free(cLeafName); + nsMemory::Free(cLeafName); PL_strfree(leafName); } diff --git a/mozilla/mailnews/base/util/nsMsgFolder.cpp b/mozilla/mailnews/base/util/nsMsgFolder.cpp index 58503cadf4f..6aae3d2f9a3 100644 --- a/mozilla/mailnews/base/util/nsMsgFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgFolder.cpp @@ -30,7 +30,7 @@ #include "nsXPIDLString.h" #include "nsCOMPtr.h" #include "nsAutoLock.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIStringBundle.h" #include "nsMsgFolder.h" @@ -892,7 +892,7 @@ NS_IMETHODIMP nsMsgFolder::GetChildWithURI(const char *uri, PRBool deep, nsIMsgF // case-insensitive compare is probably LCD across OS filesystems PRBool equal = (folderURI && nsCRT::strcasecmp(folderURI, uri)==0); - nsAllocator::Free(folderURI); + nsMemory::Free(folderURI); if (equal) { *child = folder; diff --git a/mozilla/mailnews/base/util/nsMsgI18N.cpp b/mozilla/mailnews/base/util/nsMsgI18N.cpp index c2da609ce1f..5a4520fbe49 100644 --- a/mozilla/mailnews/base/util/nsMsgI18N.cpp +++ b/mozilla/mailnews/base/util/nsMsgI18N.cpp @@ -604,7 +604,7 @@ nsresult nsMsgI18NConvertToEntity(const nsString& inString, nsString* outString) res = entityConv->ConvertToEntities(inString.GetUnicode(), nsIEntityConverter::html40Latin1, &entities); if (NS_SUCCEEDED(res) && (NULL != entities)) { outString->Assign(entities); - nsAllocator::Free(entities); + nsMemory::Free(entities); } } diff --git a/mozilla/mailnews/compose/public/nsIMsgSend.idl b/mozilla/mailnews/compose/public/nsIMsgSend.idl index d2343349c7e..1a7e2272569 100644 --- a/mozilla/mailnews/compose/public/nsIMsgSend.idl +++ b/mozilla/mailnews/compose/public/nsIMsgSend.idl @@ -166,7 +166,7 @@ interface nsIMsgSend : nsISupports in PRUint32 attachment1_body_length, [const] in nsMsgAttachmentData attachments, [const] in nsMsgAttachedFile preloaded_attachments, - in voidStar relatedPart, + in voidPtr relatedPart, [array, size_is(listeners)] in nsIMsgSendListener aListenerArray, in unsigned long listeners); diff --git a/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp b/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp index 0c1f58d056b..53472607752 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp @@ -1568,7 +1568,7 @@ msg_pick_real_name (nsMsgAttachmentHandler *attachment, const char *charset) } if (NULL != utf8Str) { - nsAllocator::Free(utf8Str); + nsMemory::Free(utf8Str); } /* ... and then put backslashes before special characters (RFC 822 tells us @@ -1951,7 +1951,7 @@ nsMsgGetExtensionFromFileURL(nsString aUrl) ERROR_OUT: if (url) - nsAllocator::Free(url); + nsMemory::Free(url); return nsnull; } diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index 68df60e2c0e..b021fa712b4 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -662,7 +662,7 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode, if (NS_SUCCEEDED(rv) && NULL != bodyText) { msgBody = bodyText; - nsAllocator::Free(bodyText); + nsMemory::Free(bodyText); // Convert body to mail charset not to utf-8 (because we don't manipulate body text) char *outCString = NULL; diff --git a/mozilla/mailnews/compose/src/nsMsgSend.cpp b/mozilla/mailnews/compose/src/nsMsgSend.cpp index 57e878400e4..e67c583e84c 100644 --- a/mozilla/mailnews/compose/src/nsMsgSend.cpp +++ b/mozilla/mailnews/compose/src/nsMsgSend.cpp @@ -1646,7 +1646,7 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN else if (image) image->SetSrc(NS_ConvertASCIItoUCS2(domSaveArray[i].url)); - nsAllocator::Free(domSaveArray[i].url); + nsMemory::Free(domSaveArray[i].url); } PR_FREEIF(domSaveArray); diff --git a/mozilla/mailnews/compose/tests/compose/test.cpp b/mozilla/mailnews/compose/tests/compose/test.cpp index ba01ddff93e..38ba362ea9b 100644 --- a/mozilla/mailnews/compose/tests/compose/test.cpp +++ b/mozilla/mailnews/compose/tests/compose/test.cpp @@ -43,7 +43,7 @@ #include "nsINetSupportDialogService.h" #include "nsIAppShellService.h" #include "nsAppShellCIDs.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIGenericFactory.h" #include "nsIWebShellWindow.h" @@ -94,7 +94,7 @@ static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID); static NS_DEFINE_CID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID); static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID); -static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); +static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); static NS_DEFINE_IID(kICharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_IID); static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); @@ -266,7 +266,7 @@ SetupRegistry(void) nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponent(kMemoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); // prefs nsComponentManager::RegisterComponent(kPrefCID, NULL, NULL, PREF_DLL, PR_FALSE, PR_FALSE); diff --git a/mozilla/mailnews/compose/tests/geturl/geturl.cpp b/mozilla/mailnews/compose/tests/geturl/geturl.cpp index 480b6e627d9..84ef5d6b70f 100644 --- a/mozilla/mailnews/compose/tests/geturl/geturl.cpp +++ b/mozilla/mailnews/compose/tests/geturl/geturl.cpp @@ -43,7 +43,7 @@ #include "nsMimeTypes.h" #include "nsIPref.h" #include "prprf.h" -#include "nsIAllocator.h" // for the CID +#include "nsIMemory.h" // for the CID #include "nsURLFetcher.h" #include "nsIIOService.h" @@ -107,12 +107,12 @@ SetupRegistry(void) // netlib // xpcom - static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); + static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); static NS_DEFINE_CID(kEventQueueCID, NS_EVENTQUEUE_CID); nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponent(kMemoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); // prefs nsComponentManager::RegisterComponent(kPrefCID, NULL, NULL, PREF_DLL, PR_FALSE, PR_FALSE); diff --git a/mozilla/mailnews/compose/tests/sendpage/Test.cpp b/mozilla/mailnews/compose/tests/sendpage/Test.cpp index 4c1f028dac8..18c41d0f2c5 100644 --- a/mozilla/mailnews/compose/tests/sendpage/Test.cpp +++ b/mozilla/mailnews/compose/tests/sendpage/Test.cpp @@ -27,7 +27,7 @@ #include "prmem.h" #include "nsIComponentManager.h" #include "nsIPref.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIEventQueueService.h" #include "nsMsgCompCID.h" #include "nsIGenericFactory.h" @@ -63,7 +63,7 @@ ///////////////////////////////////////////////////////////////////////////////// static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); -static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); +static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); static NS_DEFINE_CID(kMsgCompFieldsCID, NS_MSGCOMPFIELDS_CID); static NS_DEFINE_CID(kMsgSendCID, NS_MSGSEND_CID); static NS_DEFINE_CID(kEventQueueCID, NS_EVENTQUEUE_CID); @@ -279,7 +279,7 @@ SetupRegistry(void) nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponent(kMemoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); // prefs nsComponentManager::RegisterComponent(kPrefCID, NULL, NULL, PREF_DLL, PR_FALSE, PR_FALSE); diff --git a/mozilla/mailnews/db/msgdb/src/nsDBFolderInfo.cpp b/mozilla/mailnews/db/msgdb/src/nsDBFolderInfo.cpp index d349b74dfef..f8455bcc556 100644 --- a/mozilla/mailnews/db/msgdb/src/nsDBFolderInfo.cpp +++ b/mozilla/mailnews/db/msgdb/src/nsDBFolderInfo.cpp @@ -719,7 +719,7 @@ nsresult nsDBFolderInfo::SetPropertyWithToken(mdb_token aProperty, nsString *pro if (m_mdbRow) { nsresult err = m_mdbRow->AddColumn(m_mdb->GetEnv(), aProperty, m_mdb->nsStringToYarn(&yarn, propertyStr)); - nsAllocator::Free((char *)yarn.mYarn_Buf); // won't need this when we have nsCString + nsMemory::Free((char *)yarn.mYarn_Buf); // won't need this when we have nsCString return err; } else diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 560361f3949..5a10625b3a0 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -227,7 +227,7 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile folder->GetFlags((PRUint32 *)&flags); folder->SetParent(this); - nsAllocator::Free(uriStr); + nsMemory::Free(uriStr); flags |= MSG_FOLDER_FLAG_MAIL; diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 63d8966f88e..a34715601c0 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -2302,7 +2302,7 @@ void nsImapProtocol::SelectMailbox(const char *mailboxName) commandBuffer.Append(escapedName); commandBuffer.Append("\"" CRLF); - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult res; res = SendData(commandBuffer.GetBuffer()); if (NS_FAILED(res)) return; @@ -2624,7 +2624,7 @@ nsImapProtocol::FetchMessage(const char * messageIds, nsresult rv = SendData(protocolString); - nsAllocator::Free(cCommandStr); + nsMemory::Free(cCommandStr); if (NS_SUCCEEDED(rv)) ParseIMAPandCheckForNewMail(protocolString); PR_Free(protocolString); @@ -4583,7 +4583,7 @@ done: rv = fileSpec->IsStreamOpen(&isOpen); if (NS_SUCCEEDED(rv) && isOpen) fileSpec->CloseStream(); - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); } //caller must free using PR_Free @@ -4677,7 +4677,7 @@ void nsImapProtocol::OnRefreshACLForFolder(const char *mailboxName) command.Append(escapedName); command.Append("\"" CRLF); - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -4846,7 +4846,7 @@ void nsImapProtocol::GetMyRightsForFolder(const char *mailboxName) command.Append(escapedName); command.Append("\"" CRLF); - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -4864,7 +4864,7 @@ void nsImapProtocol::OnStatusForFolder(const char *mailboxName) command.Append(escapedName); command.Append("\" (UIDNEXT MESSAGES UNSEEN)" CRLF); - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -5659,7 +5659,7 @@ void nsImapProtocol::CreateMailbox(const char *mailboxName) command += escapedName; command += "\""CRLF; - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if(NS_SUCCEEDED(rv)) @@ -5677,7 +5677,7 @@ void nsImapProtocol::DeleteMailbox(const char *mailboxName) command += " delete \""; command += escapedName; command += "\"" CRLF; - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -5699,8 +5699,8 @@ void nsImapProtocol::RenameMailbox(const char *existingName, command += "\" \""; command += escapedNewName; command += "\"" CRLF; - nsAllocator::Free(escapedExistingName); - nsAllocator::Free(escapedNewName); + nsMemory::Free(escapedExistingName); + nsMemory::Free(escapedNewName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -5745,7 +5745,7 @@ void nsImapProtocol::Lsub(const char *mailboxPattern, PRBool addDirectoryIfNeces // GetServerCommandTag(), // command tag // escapedPattern); - nsAllocator::Free(escapedPattern); + nsMemory::Free(escapedPattern); PR_FREEIF(boxnameWithOnlineDirectory); nsresult rv = SendData(command.GetBuffer()); @@ -5778,7 +5778,7 @@ void nsImapProtocol::List(const char *mailboxPattern, PRBool addDirectoryIfNeces // GetServerCommandTag(), // command tag // escapedPattern); - nsAllocator::Free(escapedPattern); + nsMemory::Free(escapedPattern); PR_FREEIF(boxnameWithOnlineDirectory); nsresult rv = SendData(command.GetBuffer()); @@ -5798,7 +5798,7 @@ void nsImapProtocol::Subscribe(const char *mailboxName) command += " subscribe \""; command += escapedName; command += "\""CRLF; - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -5816,7 +5816,7 @@ void nsImapProtocol::Unsubscribe(const char *mailboxName) command += " unsubscribe \""; command += escapedName; command += "\""CRLF; - nsAllocator::Free(escapedName); + nsMemory::Free(escapedName); nsresult rv = SendData(command.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -5866,7 +5866,7 @@ void nsImapProtocol::Copy(const char * messageList, if (NS_SUCCEEDED(rv)) ParseIMAPandCheckForNewMail(protocolString.GetBuffer()); - nsAllocator::Free(escapedDestination); + nsMemory::Free(escapedDestination); } void nsImapProtocol::NthLevelChildList(const char* onlineMailboxPrefix, diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraImport.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraImport.cpp index bd6d8efbbf3..9cb730f75ab 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraImport.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraImport.cpp @@ -32,7 +32,7 @@ #include "nsIImportService.h" #include "nsIComponentManager.h" #include "nsEudoraImport.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIImportService.h" #include "nsIImportMail.h" #include "nsIImportMailboxDescriptor.h" diff --git a/mozilla/mailnews/import/oexpress/nsOEImport.cpp b/mozilla/mailnews/import/oexpress/nsOEImport.cpp index 748d7956eae..d02d79409f7 100644 --- a/mozilla/mailnews/import/oexpress/nsOEImport.cpp +++ b/mozilla/mailnews/import/oexpress/nsOEImport.cpp @@ -33,7 +33,7 @@ #include "nsIServiceManager.h" #include "nsIImportService.h" #include "nsOEImport.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsOEScanBoxes.h" #include "nsIImportService.h" #include "nsIImportMail.h" diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp index cc2c152852b..b8934be9211 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp @@ -34,7 +34,7 @@ #include "nsIImportService.h" #include "nsIComponentManager.h" #include "nsOutlookImport.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIImportService.h" #include "nsIImportMail.h" #include "nsIImportMailboxDescriptor.h" diff --git a/mozilla/mailnews/import/src/nsImportService.cpp b/mozilla/mailnews/import/src/nsImportService.cpp index a1fa1ca06d6..be6d7675d0c 100644 --- a/mozilla/mailnews/import/src/nsImportService.cpp +++ b/mozilla/mailnews/import/src/nsImportService.cpp @@ -32,7 +32,7 @@ #include "nsString.h" #include "nsIComponentManager.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIEnumerator.h" #include "nsIImportModule.h" #include "nsIImportService.h" @@ -686,7 +686,7 @@ void nsImportModuleList::ClearList( void) m_pList[i] = nsnull; } m_count = 0; - nsAllocator::Free( m_pList); + nsMemory::Free( m_pList); m_pList = nsnull; m_alloc = 0; } diff --git a/mozilla/mailnews/import/text/src/nsTextImport.cpp b/mozilla/mailnews/import/text/src/nsTextImport.cpp index b348385f16a..2c624693ea6 100644 --- a/mozilla/mailnews/import/text/src/nsTextImport.cpp +++ b/mozilla/mailnews/import/text/src/nsTextImport.cpp @@ -32,7 +32,7 @@ #include "nsIImportService.h" #include "nsIComponentManager.h" #include "nsTextImport.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIImportGeneric.h" #include "nsIImportAddressBooks.h" #include "nsIImportABDescriptor.h" diff --git a/mozilla/mailnews/local/public/nsIPop3Sink.idl b/mozilla/mailnews/local/public/nsIPop3Sink.idl index f1d5e70d7f8..1287f624314 100644 --- a/mozilla/mailnews/local/public/nsIPop3Sink.idl +++ b/mozilla/mailnews/local/public/nsIPop3Sink.idl @@ -40,20 +40,20 @@ interface nsIPop3Sink : nsISupports { void AbortMailDelivery(); /* returns a closure ? */ - [noscript] voidStar IncorporateBegin(in string uidlString, in nsIURI aURL, - in unsigned long flags); + [noscript] voidPtr IncorporateBegin(in string uidlString, in nsIURI aURL, + in unsigned long flags); - [noscript] void IncorporateWrite(in voidStar closure, in string block, + [noscript] void IncorporateWrite(in voidPtr closure, in string block, in long length); - [noscript] void IncorporateComplete(in voidStar closure); - [noscript] void IncorporateAbort(in voidStar closure, in long status); + [noscript] void IncorporateComplete(in voidPtr closure); + [noscript] void IncorporateAbort(in voidPtr closure, in long status); void BiffGetNewMail(); void SetBiffStateAndUpdateFE(in unsigned long biffState, in long numNewMessages); - [noscript] void SetSenderAuthedFlag(in voidStar closure, in boolean authed); + [noscript] void SetSenderAuthedFlag(in voidPtr closure, in boolean authed); attribute nsIPop3IncomingServer popServer; attribute nsIMsgFolder folder; diff --git a/mozilla/mailnews/mime/src/mimemoz2.cpp b/mozilla/mailnews/mime/src/mimemoz2.cpp index 8f3077b1617..01dfd747921 100644 --- a/mozilla/mailnews/mime/src/mimemoz2.cpp +++ b/mozilla/mailnews/mime/src/mimemoz2.cpp @@ -483,7 +483,7 @@ NotifyEmittersOfAttachmentList(MimeDisplayOptions *opt, mimeEmitterAddAttachmentField(opt, HEADER_X_MOZILLA_PART_URL, spec); if (spec) - nsAllocator::Free(spec); + nsMemory::Free(spec); if ( (opt->format_out == nsMimeOutput::nsMimeMessageQuoting) || (opt->format_out == nsMimeOutput::nsMimeMessageBodyQuoting) || diff --git a/mozilla/mailnews/mime/src/nsStreamConverter.cpp b/mozilla/mailnews/mime/src/nsStreamConverter.cpp index 89645d37e77..08c71043b34 100644 --- a/mozilla/mailnews/mime/src/nsStreamConverter.cpp +++ b/mozilla/mailnews/mime/src/nsStreamConverter.cpp @@ -38,7 +38,7 @@ #include "nsString.h" #include "nsIServiceManager.h" #include "nsXPIDLString.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIPipe.h" #include "nsMimeStringResources.h" #include "nsIPref.h" @@ -608,12 +608,12 @@ NS_IMETHODIMP nsStreamConverter::GetContentType(char **aOutputContentType) if (!aOutputContentType) return NS_ERROR_NULL_POINTER; - // since this method passes a string through an IDL file we need to use nsAllocator to allocate it + // since this method passes a string through an IDL file we need to use nsMemory to allocate it // and not nsCRT::strdup! if (nsCRT::strcasecmp(mOutputFormat, "raw") == 0) - *aOutputContentType = (char *) nsAllocator::Clone(UNKNOWN_CONTENT_TYPE, nsCRT::strlen(UNKNOWN_CONTENT_TYPE) + 1); + *aOutputContentType = (char *) nsMemory::Clone(UNKNOWN_CONTENT_TYPE, nsCRT::strlen(UNKNOWN_CONTENT_TYPE) + 1); else - *aOutputContentType = (char *) nsAllocator::Clone(mOutputFormat, nsCRT::strlen(mOutputFormat) + 1); + *aOutputContentType = (char *) nsMemory::Clone(mOutputFormat, nsCRT::strlen(mOutputFormat) + 1); return NS_OK; } diff --git a/mozilla/mailnews/mime/tests/mimetest/mimetest.cpp b/mozilla/mailnews/mime/tests/mimetest/mimetest.cpp index c7b26f7a34d..8f5c19e9246 100644 --- a/mozilla/mailnews/mime/tests/mimetest/mimetest.cpp +++ b/mozilla/mailnews/mime/tests/mimetest/mimetest.cpp @@ -42,7 +42,7 @@ #include "nsIPref.h" #include "nsICharsetConverterManager.h" #include "prprf.h" -#include "nsIAllocator.h" // for the CID +#include "nsIMemory.h" // for the CID #include "msgCore.h" #include "nsIIOService.h" #include "nsMimeEmitterCID.h" diff --git a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp index 484dd0fe546..edcf06621e9 100644 --- a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp @@ -37,7 +37,7 @@ #include "nsINNTPArticleList.h" #include "nsIOutputStream.h" #include "nsFileStream.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIPipe.h" #include "nsCOMPtr.h" diff --git a/mozilla/modules/libjar/nsJAR.cpp b/mozilla/modules/libjar/nsJAR.cpp index f60ef9149b8..9266923ed7f 100644 --- a/mozilla/modules/libjar/nsJAR.cpp +++ b/mozilla/modules/libjar/nsJAR.cpp @@ -780,7 +780,7 @@ void nsJAR::ReportError(const char* aFilename, PRInt16 errorCode) PRUnichar* messageUni = message.ToNewUnicode(); if (!messageUni) return; console->LogStringMessage(messageUni); - nsAllocator::Free(messageUni); + nsMemory::Free(messageUni); } #ifndef DEBUG else // If JS console reporting failed, print to stderr. @@ -789,7 +789,7 @@ void nsJAR::ReportError(const char* aFilename, PRInt16 errorCode) char* messageCstr = message.ToNewCString(); if (!messageCstr) return; fprintf(stderr, "%s\n", messageCstr); - nsAllocator::Free(messageCstr); + nsMemory::Free(messageCstr); } } diff --git a/mozilla/modules/libpref/public/nsIPref.idl b/mozilla/modules/libpref/public/nsIPref.idl index c24871279d7..b974c87333f 100644 --- a/mozilla/modules/libpref/public/nsIPref.idl +++ b/mozilla/modules/libpref/public/nsIPref.idl @@ -83,7 +83,7 @@ interface nsIPref : nsISupports { long GetPrefType(in string pref); long GetIntPref(in string pref); boolean GetBoolPref(in string pref); - [noscript] void GetBinaryPref(in string pref, in voidStar buf, inout long buf_length); + [noscript] void GetBinaryPref(in string pref, in voidPtr buf, inout long buf_length); unsigned long GetColorPrefDWord(in string pref); /* set preferences */ @@ -91,7 +91,7 @@ interface nsIPref : nsISupports { void SetUnicharPref(in string pref, in wstring value); void SetIntPref(in string pref, in long value); void SetBoolPref(in string pref, in boolean value); - [noscript] void SetBinaryPref(in string pref, in voidStar value, in unsigned long size); + [noscript] void SetBinaryPref(in string pref, in voidPtr value, in unsigned long size); void ClearUserPref(in string pref_name); @@ -99,7 +99,7 @@ interface nsIPref : nsISupports { /* get defaults */ long GetDefaultIntPref(in string pref); boolean GetDefaultBoolPref(in string pref); - [noscript] void GetDefaultBinaryPref(in string pref, in voidStar value, + [noscript] void GetDefaultBinaryPref(in string pref, in voidPtr value, out long length); /* set defaults */ @@ -107,19 +107,19 @@ interface nsIPref : nsISupports { void SetDefaultUnicharPref(in string pref, in wstring value); void SetDefaultIntPref(in string pref, in long value); void SetDefaultBoolPref(in string pref, in boolean value); - [noscript] void SetDefaultBinaryPref(in string pref, in voidStar value, in unsigned long size); + [noscript] void SetDefaultBinaryPref(in string pref, in voidPtr value, in unsigned long size); // these are eventually changing from Copy->get string CopyCharPref(in string pref); wstring CopyUnicharPref(in string pref); - [noscript] voidStar CopyBinaryPref(in string pref, out long size); + [noscript] voidPtr CopyBinaryPref(in string pref, out long size); // "localized" prefs - stored in the properties files wstring getLocalizedUnicharPref(in string pref); string CopyDefaultCharPref(in string pref); wstring CopyDefaultUnicharPref(in string pref); - [noscript] voidStar CopyDefaultBinaryPref(in string pref, out long size); + [noscript] voidPtr CopyDefaultBinaryPref(in string pref, out long size); nsIFileSpec GetFilePref(in string pref); void SetFilePref(in string pref, in nsIFileSpec value, in boolean setDefault); @@ -133,10 +133,10 @@ interface nsIPref : nsISupports { /* callbacks */ [noscript] void RegisterCallback(in string domain, in PrefChangedFunc callback, - in voidStar closure); + in voidPtr closure); [noscript] void UnregisterCallback(in string domain, in PrefChangedFunc callback, - in voidStar closure); + in voidPtr closure); /* void CopyPrefsTree(in string srcRoot, in string destRoot); */ @@ -157,5 +157,5 @@ interface nsIPref : nsISupports { */ [noscript] void EnumerateChildren(in string parent, in PrefEnumerationFunc callback, - in voidStar data); + in voidPtr data); }; diff --git a/mozilla/modules/libpref/public/nsIPrefBranch.idl b/mozilla/modules/libpref/public/nsIPrefBranch.idl index ff0a3a362ba..9cb873d67f7 100644 --- a/mozilla/modules/libpref/public/nsIPrefBranch.idl +++ b/mozilla/modules/libpref/public/nsIPrefBranch.idl @@ -128,7 +128,7 @@ interface nsIPrefBranch : nsISupports [noscript] void EnumerateChildren(in string parent, in PrefEnumerationFunc callback, - in voidStar data); + in voidPtr data); /* * Listeners/Callbacks */ @@ -148,10 +148,10 @@ interface nsIPrefBranch : nsISupports */ [noscript] void registerCallback(in string domain, in PrefChangedFunc callback, - in voidStar closure); + in voidPtr closure); [noscript] void unregisterCallback(in string domain, in PrefChangedFunc callback, - in voidStar closure); + in voidPtr closure); }; diff --git a/mozilla/modules/libreg/xpcom/nsRegistry.cpp b/mozilla/modules/libreg/xpcom/nsRegistry.cpp index d0a19f39314..0354f2e8390 100644 --- a/mozilla/modules/libreg/xpcom/nsRegistry.cpp +++ b/mozilla/modules/libreg/xpcom/nsRegistry.cpp @@ -28,7 +28,7 @@ #include "prlock.h" #include "prlog.h" #include "nsCRT.h" -#include "nsAllocator.h" +#include "nsMemory.h" #include "nsCOMPtr.h" #include "nsILocalFile.h" @@ -483,7 +483,7 @@ NS_IMETHODIMP nsRegistry::OpenWellKnownRegistry( nsWellKnownRegistry regid ) { PR_Unlock(mregLock); if (regFile) - nsAllocator::Free(regFile); + nsMemory::Free(regFile); // Store the registry that was opened for optimizing future opens. mCurRegID = regid; @@ -689,7 +689,7 @@ NS_IMETHODIMP nsRegistry::GetStringUTF8( nsRegistryKey baseKey, const char *path // See if that worked. if( rv == NS_OK ) { - *result =(char*)nsAllocator::Alloc( length + 1 ); + *result =(char*)nsMemory::Alloc( length + 1 ); if( *result ) { // Get string from registry into result buffer. @@ -788,7 +788,7 @@ NS_IMETHODIMP nsRegistry::GetBytesUTF8( nsRegistryKey baseKey, const char *path, // See if that worked. if( rv == NS_OK ) { - *result = NS_REINTERPRET_CAST(PRUint8*,nsAllocator::Alloc( *length )); + *result = NS_REINTERPRET_CAST(PRUint8*,nsMemory::Alloc( *length )); if( *result ) { // Get bytes from registry into result field. @@ -1335,7 +1335,7 @@ NS_IMETHODIMP nsRegistry::EscapeKey(PRUint8* key, PRUint32 termination, PRUint32 } // New length includes two extra chars for escapees. *length += escapees * 2; - *escaped = (PRUint8*)nsAllocator::Alloc(*length + termination); + *escaped = (PRUint8*)nsMemory::Alloc(*length + termination); if (*escaped == nsnull) { *length = 0; @@ -1398,7 +1398,7 @@ NS_IMETHODIMP nsRegistry::UnescapeKey(PRUint8* escaped, PRUint32 termination, PR } // New length includes two extra chars for escapees. *length -= escapees * 2; - *key = (PRUint8*)nsAllocator::Alloc(*length + termination); + *key = (PRUint8*)nsMemory::Alloc(*length + termination); if (*key == nsnull) { *length = 0; @@ -1440,7 +1440,7 @@ NS_IMETHODIMP nsRegistry::UnescapeKey(PRUint8* escaped, PRUint32 termination, PR } if (escapees < 0) { - nsAllocator::Free(*key); + nsMemory::Free(*key); *length = 0; *key = nsnull; return NS_ERROR_INVALID_ARG; diff --git a/mozilla/modules/plugin/SanePlugin/nsSanePlugin.cpp b/mozilla/modules/plugin/SanePlugin/nsSanePlugin.cpp index 7ad44b58db4..eff2a999cbc 100644 --- a/mozilla/modules/plugin/SanePlugin/nsSanePlugin.cpp +++ b/mozilla/modules/plugin/SanePlugin/nsSanePlugin.cpp @@ -1021,7 +1021,7 @@ nsSanePluginInstance::GetZoomLineStyle(char ** aZoomLineStyle) if (!*aZoomLineStyle) return NS_ERROR_NULL_POINTER; - *aZoomLineStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomLineStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomLineStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1070,7 +1070,7 @@ nsSanePluginInstance::GetZoomCapStyle(char ** aZoomCapStyle) if (!*aZoomCapStyle) return NS_ERROR_NULL_POINTER; - *aZoomCapStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomCapStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomCapStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1124,7 +1124,7 @@ nsSanePluginInstance::GetZoomJoinStyle(char ** aZoomJoinStyle) if (!*aZoomJoinStyle) return NS_ERROR_NULL_POINTER; - *aZoomJoinStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomJoinStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomJoinStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1292,7 +1292,7 @@ nsSanePluginInstance::GetMethod(char ** aMethod) if (!aMethod) return NS_ERROR_NULL_POINTER; - *aMethod = (char*) nsAllocator::Alloc(8); + *aMethod = (char*) nsMemory::Alloc(8); if (!*aMethod) return NS_ERROR_OUT_OF_MEMORY; @@ -1379,7 +1379,7 @@ nsSanePluginInstance::GetDeviceOptions(char ** aDeviceOptions) // allocate string to contain data to return to caller string_size = ((optdesc->size - 1) * MAX_OPT_SIZE) + 1; - *aDeviceOptions = (char*) nsAllocator::Alloc(string_size); + *aDeviceOptions = (char*) nsMemory::Alloc(string_size); // initialize options string for (int n=0; nGetService(kPluginManagerCID, kIPluginManagerIID, (nsISupports**)&mPluginManager); if (nsnull == mMalloc) - serviceMgr->GetService(kAllocatorCID, kIAllocatorIID, (nsISupports**)&mMalloc); + serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc); } diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.h b/mozilla/modules/plugin/base/src/ns4xPlugin.h index 4c01726c084..9c03b468ce6 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.h +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.h @@ -56,7 +56,7 @@ typedef NS_CALLBACK_(NPError, NP_MAIN) (NPNetscapeFuncs* nCallbacks, NPPluginFun #endif class nsIServiceManager; -class nsIAllocator; +class nsIMemory; //////////////////////////////////////////////////////////////////////// @@ -247,7 +247,7 @@ protected: static NPNetscapeFuncs CALLBACKS; static nsIPluginManager *mPluginManager; - static nsIAllocator *mMalloc; + static nsIMemory *mMalloc; }; #endif // ns4xPlugin_h__ diff --git a/mozilla/modules/plugin/nglsrc/makefile.win b/mozilla/modules/plugin/nglsrc/makefile.win index ae52fe1b1a6..14937db7ef0 100644 --- a/mozilla/modules/plugin/nglsrc/makefile.win +++ b/mozilla/modules/plugin/nglsrc/makefile.win @@ -66,6 +66,7 @@ LINCS = \ LCFLAGS = \ $(LCFLAGS) \ -D_IMPL_NS_PLUGIN \ + -GX \ $(NULL) !ifdef NU_CACHE diff --git a/mozilla/modules/plugin/nglsrc/ns4xPlugin.cpp b/mozilla/modules/plugin/nglsrc/ns4xPlugin.cpp index 395a1d7ce87..c3d7cb5d0a7 100644 --- a/mozilla/modules/plugin/nglsrc/ns4xPlugin.cpp +++ b/mozilla/modules/plugin/nglsrc/ns4xPlugin.cpp @@ -27,7 +27,7 @@ #include "ns4xPlugin.h" #include "ns4xPluginInstance.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIPluginStreamListener.h" #include "nsPluginsDir.h" @@ -43,7 +43,7 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID); NPNetscapeFuncs ns4xPlugin::CALLBACKS; nsIPluginManager * ns4xPlugin::mPluginManager; -nsIAllocator * ns4xPlugin::mMalloc; +nsIMemory * ns4xPlugin::mMalloc; void ns4xPlugin::CheckClassInitialized(void) @@ -104,8 +104,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID); static NS_DEFINE_IID(kPluginManagerCID, NS_PLUGINMANAGER_CID); static NS_DEFINE_IID(kIPluginManagerIID, NS_IPLUGINMANAGER_IID); -static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID); -static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID); +static NS_DEFINE_IID(kMemoryCID, NS_MEMORY_CID); +static NS_DEFINE_IID(kIMemoryIID, NS_IMEMORY_IID); static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID); //////////////////////////////////////////////////////////////////////// @@ -122,7 +122,7 @@ ns4xPlugin::ns4xPlugin(NPPluginFuncs* callbacks, NP_PLUGINSHUTDOWN aShutdown, ns serviceMgr->GetService(kPluginManagerCID, kIPluginManagerIID, (nsISupports**)&mPluginManager); if (nsnull == mMalloc) - serviceMgr->GetService(kAllocatorCID, kIAllocatorIID, (nsISupports**)&mMalloc); + serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc); } diff --git a/mozilla/modules/plugin/nglsrc/ns4xPlugin.h b/mozilla/modules/plugin/nglsrc/ns4xPlugin.h index 4c01726c084..9c03b468ce6 100644 --- a/mozilla/modules/plugin/nglsrc/ns4xPlugin.h +++ b/mozilla/modules/plugin/nglsrc/ns4xPlugin.h @@ -56,7 +56,7 @@ typedef NS_CALLBACK_(NPError, NP_MAIN) (NPNetscapeFuncs* nCallbacks, NPPluginFun #endif class nsIServiceManager; -class nsIAllocator; +class nsIMemory; //////////////////////////////////////////////////////////////////////// @@ -247,7 +247,7 @@ protected: static NPNetscapeFuncs CALLBACKS; static nsIPluginManager *mPluginManager; - static nsIAllocator *mMalloc; + static nsIMemory *mMalloc; }; #endif // ns4xPlugin_h__ diff --git a/mozilla/modules/plugin/samples/SanePlugin/nsSanePlugin.cpp b/mozilla/modules/plugin/samples/SanePlugin/nsSanePlugin.cpp index 7ad44b58db4..eff2a999cbc 100644 --- a/mozilla/modules/plugin/samples/SanePlugin/nsSanePlugin.cpp +++ b/mozilla/modules/plugin/samples/SanePlugin/nsSanePlugin.cpp @@ -1021,7 +1021,7 @@ nsSanePluginInstance::GetZoomLineStyle(char ** aZoomLineStyle) if (!*aZoomLineStyle) return NS_ERROR_NULL_POINTER; - *aZoomLineStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomLineStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomLineStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1070,7 +1070,7 @@ nsSanePluginInstance::GetZoomCapStyle(char ** aZoomCapStyle) if (!*aZoomCapStyle) return NS_ERROR_NULL_POINTER; - *aZoomCapStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomCapStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomCapStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1124,7 +1124,7 @@ nsSanePluginInstance::GetZoomJoinStyle(char ** aZoomJoinStyle) if (!*aZoomJoinStyle) return NS_ERROR_NULL_POINTER; - *aZoomJoinStyle = (char*) nsAllocator::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); + *aZoomJoinStyle = (char*) nsMemory::Alloc(MAX_LINE_ATTRIBUTE_LENGTH); if (! *aZoomJoinStyle) return NS_ERROR_OUT_OF_MEMORY; @@ -1292,7 +1292,7 @@ nsSanePluginInstance::GetMethod(char ** aMethod) if (!aMethod) return NS_ERROR_NULL_POINTER; - *aMethod = (char*) nsAllocator::Alloc(8); + *aMethod = (char*) nsMemory::Alloc(8); if (!*aMethod) return NS_ERROR_OUT_OF_MEMORY; @@ -1379,7 +1379,7 @@ nsSanePluginInstance::GetDeviceOptions(char ** aDeviceOptions) // allocate string to contain data to return to caller string_size = ((optdesc->size - 1) * MAX_OPT_SIZE) + 1; - *aDeviceOptions = (char*) nsAllocator::Alloc(string_size); + *aDeviceOptions = (char*) nsMemory::Alloc(string_size); // initialize options string for (int n=0; n 0, "caller must pass in str len"); - *_retval = (char*)nsAllocator::Alloc(aLen); + *_retval = (char*)nsMemory::Alloc(aLen); if (!*_retval) return NS_ERROR_FAILURE; PRStatus status = PR_NetAddrToString(&mNetAddress, *_retval, aLen); if (PR_FAILURE == status) { - nsAllocator::Free(*_retval); + nsMemory::Free(*_retval); return NS_ERROR_FAILURE; } return NS_OK; diff --git a/mozilla/netwerk/base/src/nsURLHelper.cpp b/mozilla/netwerk/base/src/nsURLHelper.cpp index 43ce54f8f65..fc747db1c20 100644 --- a/mozilla/netwerk/base/src/nsURLHelper.cpp +++ b/mozilla/netwerk/base/src/nsURLHelper.cpp @@ -20,7 +20,7 @@ #include "nsURLHelper.h" #include "prprf.h" #include "nsCRT.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIIOService.h" #include "nsIURI.h" @@ -168,7 +168,7 @@ nsURLUnescape(char* str, char **result) static const char hexChars[] = "0123456789ABCDEF"; int len = PL_strlen(str); - *result = (char *)nsAllocator::Alloc(len + 1); + *result = (char *)nsMemory::Alloc(len + 1); if (!*result) return NS_ERROR_OUT_OF_MEMORY; @@ -381,7 +381,7 @@ NS_NET nsresult ExtractURLScheme(const char* inURI, PRUint32 *startPos, } if (scheme) { - char* str = (char*)nsAllocator::Alloc(length + 1); + char* str = (char*)nsMemory::Alloc(length + 1); if (str == nsnull) return NS_ERROR_OUT_OF_MEMORY; nsCRT::memcpy(str, &inURI[start], length); diff --git a/mozilla/netwerk/cache/filecache/nsDiskCacheRecord.cpp b/mozilla/netwerk/cache/filecache/nsDiskCacheRecord.cpp index 9ffa11a7e13..e26f456ca5f 100644 --- a/mozilla/netwerk/cache/filecache/nsDiskCacheRecord.cpp +++ b/mozilla/netwerk/cache/filecache/nsDiskCacheRecord.cpp @@ -31,7 +31,7 @@ #include "nsIServiceManager.h" #include "nsIProtocolHandler.h" #include "nsIIOService.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "prprf.h" @@ -82,7 +82,7 @@ nsDiskCacheRecord::Init(const char* key, PRUint32 length, PRInt32 ID) { // copy key mKeyLength = length ; - mKey = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ; + mKey = NS_STATIC_CAST(char*, nsMemory::Alloc(mKeyLength*sizeof(char))) ; if(!mKey) return NS_ERROR_OUT_OF_MEMORY ; @@ -116,11 +116,11 @@ nsDiskCacheRecord::Init(const char* key, PRUint32 length, PRInt32 ID) nsDiskCacheRecord::~nsDiskCacheRecord() { if(mKey) - nsAllocator::Free(mKey) ; + nsMemory::Free(mKey) ; if(mMetaData) - nsAllocator::Free(mMetaData) ; + nsMemory::Free(mMetaData) ; if(mInfo) - nsAllocator::Free(mInfo) ; + nsMemory::Free(mInfo) ; NS_IF_RELEASE(mDiskCache); } @@ -141,7 +141,7 @@ nsDiskCacheRecord::GetKey(PRUint32 *length, char** _retval) return NS_ERROR_NULL_POINTER ; *length = mKeyLength ; - *_retval = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ; + *_retval = NS_STATIC_CAST(char*, nsMemory::Alloc(mKeyLength*sizeof(char))) ; if(!*_retval) return NS_ERROR_OUT_OF_MEMORY ; @@ -170,7 +170,7 @@ nsDiskCacheRecord::GetMetaData(PRUint32 *length, char **_retval) *length = mMetaDataLength ; if(mMetaDataLength) { - *_retval = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ; + *_retval = NS_STATIC_CAST(char*, nsMemory::Alloc(mMetaDataLength*sizeof(char))) ; if(!*_retval) return NS_ERROR_OUT_OF_MEMORY ; @@ -186,8 +186,8 @@ nsDiskCacheRecord::SetMetaData(PRUint32 length, const char* data) // set the mMetaData mMetaDataLength = length ; if(mMetaData) - nsAllocator::Free(mMetaData) ; - mMetaData = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ; + nsMemory::Free(mMetaData) ; + mMetaData = NS_STATIC_CAST(char*, nsMemory::Alloc(mMetaDataLength*sizeof(char))) ; if(!mMetaData) { return NS_ERROR_OUT_OF_MEMORY ; } @@ -316,7 +316,7 @@ nsresult nsDiskCacheRecord::GenInfo() { if(mInfo) - nsAllocator::Free(mInfo) ; + nsMemory::Free(mInfo) ; char* file_url=nsnull ; PRUint32 name_len ; @@ -332,7 +332,7 @@ nsDiskCacheRecord::GenInfo() mInfoSize += sizeof(PRUint32) ; // filename length mInfoSize += name_len ; // filename - void* newInfo = nsAllocator::Alloc(mInfoSize*sizeof(char)) ; + void* newInfo = nsMemory::Alloc(mInfoSize*sizeof(char)) ; if(!newInfo) { return NS_ERROR_OUT_OF_MEMORY ; } @@ -370,7 +370,7 @@ nsDiskCacheRecord::GenInfo() memcpy(cur_ptr, file_url, name_len) ; cur_ptr += name_len ; - nsAllocator::Free(file_url); + nsMemory::Free(file_url); PR_ASSERT(cur_ptr == NS_STATIC_CAST(char*, newInfo) + mInfoSize); mInfo = newInfo ; @@ -388,16 +388,16 @@ nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength) { // reset everything if(mInfo) { - nsAllocator::Free(mInfo) ; + nsMemory::Free(mInfo) ; mInfo = nsnull ; } if(mKey) { - nsAllocator::Free(mKey) ; + nsMemory::Free(mKey) ; mKey = nsnull ; } if(mMetaData) { - nsAllocator::Free(mMetaData) ; + nsMemory::Free(mMetaData) ; mMetaData = nsnull ; } @@ -423,7 +423,7 @@ nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength) cur_ptr += sizeof(PRUint32) ; // set mKey - mKey = NS_STATIC_CAST(char*, nsAllocator::Alloc(mKeyLength*sizeof(char))) ; + mKey = NS_STATIC_CAST(char*, nsMemory::Alloc(mKeyLength*sizeof(char))) ; if(!mKey) return NS_ERROR_OUT_OF_MEMORY ; @@ -439,7 +439,7 @@ nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength) cur_ptr += sizeof(PRUint32) ; // set mMetaData - mMetaData = NS_STATIC_CAST(char*, nsAllocator::Alloc(mMetaDataLength*sizeof(char))) ; + mMetaData = NS_STATIC_CAST(char*, nsMemory::Alloc(mMetaDataLength*sizeof(char))) ; if(!mMetaData) return NS_ERROR_OUT_OF_MEMORY ; @@ -451,7 +451,7 @@ nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength) cur_ptr += sizeof(PRUint32) ; // get mFile native name - file_url = NS_STATIC_CAST(char*, nsAllocator::Alloc(name_len*sizeof(char))) ; + file_url = NS_STATIC_CAST(char*, nsMemory::Alloc(name_len*sizeof(char))) ; if(!file_url) return NS_ERROR_OUT_OF_MEMORY ; @@ -479,7 +479,7 @@ nsDiskCacheRecord::RetrieveInfo(void* aInfo, PRUint32 aInfoLength) file->InitWithPath(file_url) ; } - nsAllocator::Free(file_url); + nsMemory::Free(file_url); return NS_OK ; } diff --git a/mozilla/netwerk/cache/filecache/nsNetDiskCache.cpp b/mozilla/netwerk/cache/filecache/nsNetDiskCache.cpp index 194c025fe8e..feba66d5f17 100644 --- a/mozilla/netwerk/cache/filecache/nsNetDiskCache.cpp +++ b/mozilla/netwerk/cache/filecache/nsNetDiskCache.cpp @@ -97,7 +97,7 @@ static int PR_CALLBACK folderChanged(const char *pref, void *closure) return rv; rv = NS_NewLocalFile( path, getter_AddRefs(cacheFolder)); - nsAllocator::Free( path ); + nsMemory::Free( path ); return ( (nsNetDiskCache*)closure )->SetDiskCacheFolder( cacheFolder ); } @@ -673,7 +673,7 @@ nsNetDiskCache::SetSizeEntry(void) InfoSize = sizeof mNumEntries ; InfoSize += sizeof mStorageInUse ; - void* pInfo = nsAllocator::Alloc(InfoSize*sizeof(char)) ; + void* pInfo = nsMemory::Alloc(InfoSize*sizeof(char)) ; if(!pInfo) return NS_ERROR_OUT_OF_MEMORY ; diff --git a/mozilla/netwerk/cache/filecache/test/diskcache.cpp b/mozilla/netwerk/cache/filecache/test/diskcache.cpp index 5895dbf8ebd..2223953de13 100644 --- a/mozilla/netwerk/cache/filecache/test/diskcache.cpp +++ b/mozilla/netwerk/cache/filecache/test/diskcache.cpp @@ -343,7 +343,7 @@ TestRecordID(nsINetDataCache *cache) match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); delete randomStream; } return NS_OK; @@ -406,7 +406,7 @@ TestEnumeration(nsINetDataCache *cache) NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get record meta-data"); match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); delete randomStream; } @@ -448,7 +448,7 @@ TestRead(nsINetDataCache *cache) NS_ASSERTION(NS_SUCCEEDED(rv), " "); match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); // Test GetKey() method rv = record->GetKey(&storedCacheKeyLength, &storedCacheKey); @@ -456,7 +456,7 @@ TestRead(nsINetDataCache *cache) (storedCacheKeyLength == sizeof cacheKey) && !memcmp(storedCacheKey, &cacheKey[0], sizeof cacheKey), "nsINetDataCacheRecord::GetKey failed"); - nsAllocator::Free(storedCacheKey); + nsMemory::Free(storedCacheKey); PRUint32 expectedStreamLength = randomStream->Next() & 0xffff; diff --git a/mozilla/netwerk/cache/memcache/nsMemCacheRecord.cpp b/mozilla/netwerk/cache/memcache/nsMemCacheRecord.cpp index 990ff5406ff..fdf334ef95f 100644 --- a/mozilla/netwerk/cache/memcache/nsMemCacheRecord.cpp +++ b/mozilla/netwerk/cache/memcache/nsMemCacheRecord.cpp @@ -22,7 +22,7 @@ #include "nsMemCache.h" #include "nsMemCacheRecord.h" #include "nsMemCacheChannel.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsStorageStream.h" static NS_DEFINE_IID(kINetDataCacheRecord, NS_INETDATACACHERECORD_IID); @@ -47,7 +47,7 @@ NS_IMETHODIMP nsMemCacheRecord::GetKey(PRUint32 *aLength, char **aResult) { NS_ENSURE_ARG(aResult); - *aResult = (char *)nsAllocator::Alloc(mKeyLength); + *aResult = (char *)nsMemory::Alloc(mKeyLength); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; memcpy(*aResult, mKey, mKeyLength); @@ -92,7 +92,7 @@ nsMemCacheRecord::GetMetaData(PRUint32 *aLength, char **aResult) *aResult = 0; if (mMetaDataLength) { - *aResult = (char*)nsAllocator::Alloc(mMetaDataLength); + *aResult = (char*)nsMemory::Alloc(mMetaDataLength); if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; memcpy(*aResult, mMetaData, mMetaDataLength); diff --git a/mozilla/netwerk/cache/mgr/nsCacheEntryChannel.cpp b/mozilla/netwerk/cache/mgr/nsCacheEntryChannel.cpp index fa85646ac17..4d952c2d04e 100644 --- a/mozilla/netwerk/cache/mgr/nsCacheEntryChannel.cpp +++ b/mozilla/netwerk/cache/mgr/nsCacheEntryChannel.cpp @@ -28,7 +28,7 @@ #include "nsIIOService.h" #include "nsIServiceManager.h" #include "nsIStreamListener.h" -#include "nsIAllocator.h" +#include "nsMemory.h" nsCacheEntryChannel::nsCacheEntryChannel( nsCachedNetData* aCacheEntry, @@ -216,7 +216,7 @@ nsCacheEntryChannel::GetURI(nsIURI * *aURI) if (NS_FAILED(rv)) return rv; rv = serv->NewURI(spec, nsnull, aURI); - nsAllocator::Free(spec); + nsMemory::Free(spec); return rv; } diff --git a/mozilla/netwerk/cache/mgr/nsCacheManager.cpp b/mozilla/netwerk/cache/mgr/nsCacheManager.cpp index a3f91666caa..823ff518ac4 100644 --- a/mozilla/netwerk/cache/mgr/nsCacheManager.cpp +++ b/mozilla/netwerk/cache/mgr/nsCacheManager.cpp @@ -290,7 +290,7 @@ nsCacheManager::NoteDormant(nsCachedNetData* aEntry) nsStringKey hashTableKey(nsCString(key, keyLength)); deletedEntry = (nsCachedNetData*)gCacheManager->mActiveCacheRecords->Remove(&hashTableKey); // NS_ASSERTION(deletedEntry == aEntry, "Hash table inconsistency"); - nsAllocator::Free( key ); + nsMemory::Free( key ); return NS_OK; } diff --git a/mozilla/netwerk/cache/mgr/nsCachedNetData.cpp b/mozilla/netwerk/cache/mgr/nsCachedNetData.cpp index 73a94bfea68..3d9c04d61b3 100644 --- a/mozilla/netwerk/cache/mgr/nsCachedNetData.cpp +++ b/mozilla/netwerk/cache/mgr/nsCachedNetData.cpp @@ -59,7 +59,7 @@ public: ~StDeallocator() { if (mMemory) - nsAllocator::Free(mMemory); + nsMemory::Free(mMemory); } private: void* mMemory; @@ -165,10 +165,10 @@ class CacheMetaData { ~CacheMetaData() { if( mTag ) - nsAllocator::Free( mTag ); + nsMemory::Free( mTag ); if (mOpaqueBytes) - nsAllocator::Free(mOpaqueBytes); + nsMemory::Free(mOpaqueBytes); delete mNext; } @@ -176,14 +176,14 @@ protected: nsresult Set(PRUint32 aLength, const char* aOpaqueBytes) { char* newOpaqueBytes = 0; if (aOpaqueBytes) { - newOpaqueBytes = (char*)nsAllocator::Alloc(aLength); + newOpaqueBytes = (char*)nsMemory::Alloc(aLength); if (!newOpaqueBytes) return NS_ERROR_OUT_OF_MEMORY; memcpy(newOpaqueBytes, aOpaqueBytes, aLength); } if (mOpaqueBytes) - nsAllocator::Free(mOpaqueBytes); + nsMemory::Free(mOpaqueBytes); mOpaqueBytes = newOpaqueBytes; mLength = aLength; @@ -193,7 +193,7 @@ protected: nsresult Get(PRUint32 *aLength, char* *aOpaqueBytes) { char *copyOpaqueBytes = 0; if (mOpaqueBytes) { - copyOpaqueBytes = (char*)nsAllocator::Alloc(mLength); + copyOpaqueBytes = (char*)nsMemory::Alloc(mLength); if (!copyOpaqueBytes) return NS_ERROR_OUT_OF_MEMORY; memcpy(copyOpaqueBytes, mOpaqueBytes, mLength); @@ -460,7 +460,7 @@ nsCachedNetData::Deserialize(PRBool aDeserializeFlags) #if 0 nsCString metaDataCStr(metaData, metaDataLength); if (metaData) - nsAllocator::Free(metaData); + nsMemory::Free(metaData); nsCOMPtr stringStreamSupports; rv = NS_NewCStringInputStream(getter_AddRefs(stringStreamSupports), metaDataCStr); @@ -589,14 +589,14 @@ nsCachedNetData::GetSecondaryKey(PRUint32 *aLength, char **aSecondaryKey) secondaryKey++; if (keyLength) { - char* copy = (char*)nsAllocator::Alloc(keyLength); + char* copy = (char*)nsMemory::Alloc(keyLength); if (!copy) return NS_ERROR_OUT_OF_MEMORY; memcpy(copy, secondaryKey, keyLength); *aSecondaryKey = copy; } - nsAllocator::Free(key); + nsMemory::Free(key); *aLength = keyLength; return NS_OK; } @@ -825,16 +825,16 @@ nsCachedNetData::Commit(void) inputStream->Available(&serializedDataLength); - serializedData = (char*)nsAllocator::Alloc(serializedDataLength); + serializedData = (char*)nsMemory::Alloc(serializedDataLength); if (!serializedData) goto error; inputStream->Read(serializedData, serializedDataLength, &bytesRead); if (NS_FAILED(rv)) { - nsAllocator::Free(serializedData); + nsMemory::Free(serializedData); goto error; } rv = record->SetMetaData(serializedDataLength, serializedData); - nsAllocator::Free(serializedData); + nsMemory::Free(serializedData); return rv; error: diff --git a/mozilla/netwerk/cache/mgr/nsReplacementPolicy.cpp b/mozilla/netwerk/cache/mgr/nsReplacementPolicy.cpp index 99d7b9dd4fd..2d3ae8a2edc 100644 --- a/mozilla/netwerk/cache/mgr/nsReplacementPolicy.cpp +++ b/mozilla/netwerk/cache/mgr/nsReplacementPolicy.cpp @@ -25,7 +25,7 @@ #include "nsCachedNetData.h" #include "nsQuickSort.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIEnumerator.h" #include "prtime.h" #include "prinrval.h" @@ -43,9 +43,9 @@ nsReplacementPolicy::nsReplacementPolicy() nsReplacementPolicy::~nsReplacementPolicy() { if (mRankedEntries) - nsAllocator::Free(mRankedEntries); + nsMemory::Free(mRankedEntries); if (mMapRecordIdToEntry) - nsAllocator::Free(mMapRecordIdToEntry); + nsMemory::Free(mMapRecordIdToEntry); delete mCaches; } @@ -62,7 +62,7 @@ nsReplacementPolicy::Init(PRUint32 aMaxCacheEntries) // Hash array length must be power-of-two mHashArrayLength = (1 << PR_CeilingLog2(aMaxCacheEntries)) >> 3; size_t numBytes = mHashArrayLength * sizeof(*mMapRecordIdToEntry); - mMapRecordIdToEntry = (nsCachedNetData**)nsAllocator::Alloc(numBytes); + mMapRecordIdToEntry = (nsCachedNetData**)nsMemory::Alloc(numBytes); if (!mMapRecordIdToEntry) return NS_ERROR_OUT_OF_MEMORY; @@ -484,7 +484,7 @@ nsReplacementPolicy::AssociateCacheEntryWithRecord(nsINetDataCacheRecord *aRecor nsCachedNetData** newRankedEntriesArray; PRUint32 numBytes = sizeof(nsCachedNetData*) * newCapacity; newRankedEntriesArray = - (nsCachedNetData**)nsAllocator::Realloc(mRankedEntries, numBytes); + (nsCachedNetData**)nsMemory::Realloc(mRankedEntries, numBytes); if (!newRankedEntriesArray) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/netwerk/dns/src/nsDnsService.cpp b/mozilla/netwerk/dns/src/nsDnsService.cpp index 79b992e2877..e307ea3a44a 100644 --- a/mozilla/netwerk/dns/src/nsDnsService.cpp +++ b/mozilla/netwerk/dns/src/nsDnsService.cpp @@ -503,7 +503,7 @@ nsDNSLookup::InitiateLookup(void) if (numeric || (colon && hex)) { // presume it is numeric and try to converting to an IP-Address - PRNetAddr *netAddr = (PRNetAddr*)nsAllocator::Alloc(sizeof(PRNetAddr)); + PRNetAddr *netAddr = (PRNetAddr*)nsMemory::Alloc(sizeof(PRNetAddr)); if (!netAddr) return NS_ERROR_OUT_OF_MEMORY; status = PR_StringToNetAddr(mHostName, netAddr);; @@ -548,7 +548,7 @@ nsDNSLookup::InitiateLookup(void) nsStringKey key(mHostName); (void) nsDNSService::gService->mLookups.Remove(&key); } - nsAllocator::Free(netAddr); + nsMemory::Free(netAddr); if(PR_SUCCESS == status) // it WAS numeric, we're done. return rv; } diff --git a/mozilla/netwerk/mime/src/nsMIMEInfoImpl.cpp b/mozilla/netwerk/mime/src/nsMIMEInfoImpl.cpp index 4dfca87faf0..3b1359102f1 100644 --- a/mozilla/netwerk/mime/src/nsMIMEInfoImpl.cpp +++ b/mozilla/netwerk/mime/src/nsMIMEInfoImpl.cpp @@ -45,7 +45,7 @@ nsMIMEInfoImpl::GetFileExtensions(PRUint32 *elementCount, char ***extensions) { *elementCount = mExtensions.Count(); if (*elementCount < 1) return NS_OK;; - char **_retExts = (char**)nsAllocator::Alloc((*elementCount)*2*sizeof(char*)); + char **_retExts = (char**)nsMemory::Alloc((*elementCount)*2*sizeof(char*)); if (!_retExts) return NS_ERROR_OUT_OF_MEMORY; for (PRUint8 i=0; i < *elementCount; i++) { diff --git a/mozilla/netwerk/mime/src/nsMIMEService.cpp b/mozilla/netwerk/mime/src/nsMIMEService.cpp index 04ebd4543f0..2eb2718adf3 100644 --- a/mozilla/netwerk/mime/src/nsMIMEService.cpp +++ b/mozilla/netwerk/mime/src/nsMIMEService.cpp @@ -173,7 +173,7 @@ nsMIMEService::GetTypeFromURI(nsIURI *aURI, char **aContentType) { char *ext = extStr.ToNewCString(); if (!ext) return NS_ERROR_OUT_OF_MEMORY; rv = GetTypeFromExtension(ext, aContentType); - nsAllocator::Free(ext); + nsMemory::Free(ext); } else return NS_ERROR_FAILURE; diff --git a/mozilla/netwerk/mime/src/nsXMLMIMEDataSource.cpp b/mozilla/netwerk/mime/src/nsXMLMIMEDataSource.cpp index ebee0d11ba2..97a2ae30c1f 100644 --- a/mozilla/netwerk/mime/src/nsXMLMIMEDataSource.cpp +++ b/mozilla/netwerk/mime/src/nsXMLMIMEDataSource.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file @@ -150,15 +150,15 @@ nsXMLMIMEDataSource::AddMapping(const char* mimeType, NS_IMETHODIMP nsXMLMIMEDataSource::Add( nsIMIMEInfo* aMapper ) { - if ( !aMapper ) - return NS_ERROR_NULL_POINTER; + if ( !aMapper ) + return NS_ERROR_NULL_POINTER; nsresult rv = NS_OK; - nsXPIDLCString mimeType; - rv = aMapper->GetMIMEType( getter_Copies( mimeType ) ); - if ( NS_FAILED( rv ) ) - return rv; + nsXPIDLCString mimeType; + rv = aMapper->GetMIMEType( getter_Copies( mimeType ) ); + if ( NS_FAILED( rv ) ) + return rv; // First remove any existing mapping. rv = Remove(mimeType); if (NS_FAILED(rv)) return rv; @@ -174,19 +174,19 @@ nsXMLMIMEDataSource::Add( nsIMIMEInfo* aMapper ) // Finally add an extension mapping. char** extensions; - PRUint32 count; - rv = aMapper->GetFileExtensions(& count, &extensions ); - if ( NS_FAILED ( rv ) ) - return rv; - for ( PRUint32 i = 0; iPut(&key, aMapper); - NS_ASSERTION(!oldInfo, "file extension mappings should have been cleaned up in the RemoveMapping call"); - NS_ADDREF(aMapper); - nsAllocator::Free( extensions[i] ); - } - nsAllocator::Free( extensions ); + PRUint32 count; + rv = aMapper->GetFileExtensions(& count, &extensions ); + if ( NS_FAILED ( rv ) ) + return rv; + for ( PRUint32 i = 0; iPut(&key, aMapper); + NS_ASSERTION(!oldInfo, "file extension mappings should have been cleaned up in the RemoveMapping call"); + NS_ADDREF(aMapper); + nsMemory::Free( extensions[i] ); + } + nsMemory::Free( extensions ); return NS_OK; } @@ -334,10 +334,10 @@ nsXMLMIMEDataSource::Serialize() { buffer+= kDescription; buffer+="=\""; nsString temp( unidata ); - nsAllocator::Free( unidata ); + nsMemory::Free( unidata ); char* utf8 = temp.ToNewUTF8String(); buffer+=utf8; - nsAllocator::Free( utf8 ); + nsMemory::Free( utf8 ); buffer+="\" "; rv = info->GetMIMEType( getter_Copies( cdata ) ); @@ -359,12 +359,12 @@ nsXMLMIMEDataSource::Serialize() { { buffer+=extensions[i]; buffer+=","; - nsAllocator::Free( extensions[i] ); + nsMemory::Free( extensions[i] ); } buffer+=extensions[count-1]; buffer+="\" "; - nsAllocator::Free( extensions[count-1] ); - nsAllocator::Free( extensions ); + nsMemory::Free( extensions[count-1] ); + nsMemory::Free( extensions ); PRUint32 macData; char macBuffer[8]; @@ -672,7 +672,7 @@ public: ~StDeallocator() { if (mMemory) - nsAllocator::Free(mMemory); + nsMemory::Free(mMemory); } private: void* mMemory; diff --git a/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp b/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp index aefe336fff1..f87f9fdbf64 100644 --- a/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp +++ b/mozilla/netwerk/protocol/data/src/nsDataChannel.cpp @@ -165,7 +165,7 @@ nsDataChannel::ParseData() { PRUint32 dataLen = PL_strlen(dataBuffer); PRUint32 wrote; - writeData *dataToWrite = (writeData*)nsAllocator::Alloc(sizeof(writeData)); + writeData *dataToWrite = (writeData*)nsMemory::Alloc(sizeof(writeData)); if (!dataToWrite) return NS_ERROR_OUT_OF_MEMORY; if (lBase64) { @@ -188,7 +188,7 @@ nsDataChannel::ParseData() { rv = bufOutStream->WriteSegments(nsReadData, dataToWrite, dataToWrite->dataLen, &wrote); - nsAllocator::Free(decodedData); + nsMemory::Free(decodedData); } else { dataToWrite->dataLen = dataLen; dataToWrite->data = dataBuffer; @@ -205,8 +205,8 @@ nsDataChannel::ParseData() { *comma = ','; - nsAllocator::Free(dataToWrite); - if (cleanup) nsAllocator::Free(dataBuffer); + nsMemory::Free(dataToWrite); + if (cleanup) nsMemory::Free(dataBuffer); return NS_OK; } diff --git a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index 706aca3e8b6..75d5a288f6a 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -87,7 +87,7 @@ nsFtpConnectionThread::~nsFtpConnectionThread() { mURL->GetSpec(getter_Copies(spec)); PR_LOG(gFTPLog, PR_LOG_ALWAYS, ("~nsFtpConnectionThread() for %s", (const char*)spec)); if (mLock) PR_DestroyLock(mLock); - if (mIPv6ServerAddress) nsAllocator::Free(mIPv6ServerAddress); + if (mIPv6ServerAddress) nsMemory::Free(mIPv6ServerAddress); } nsresult @@ -237,7 +237,7 @@ nsFtpConnectionThread::Process() { if (*tmpBuffer) carryOverBuf = tmpBuffer; - if (cleanup) nsAllocator::Free(cleanup); + if (cleanup) nsMemory::Free(cleanup); // see if this was the last line if (lastLine) { @@ -1174,7 +1174,7 @@ nsFtpConnectionThread::R_mdtm() { ts.tm_min = (timeStr[10] - '0') * 10 + (timeStr[11] - '0'); ts.tm_sec = (timeStr[12] - '0') * 10 + (timeStr[13] - '0'); ts.tm_usec = 0; - nsAllocator::Free(timeStr); + nsMemory::Free(timeStr); mLastModified = PR_ImplodeTime(&ts); } @@ -1331,7 +1331,7 @@ nsFtpConnectionThread::S_pasv() { PRNetAddr addr; if (PR_StringToNetAddr(mIPv6ServerAddress, &addr) != PR_SUCCESS || PR_IsNetAddrType(&addr, PR_IpAddrV4Mapped)) { - nsAllocator::Free(mIPv6ServerAddress); + nsMemory::Free(mIPv6ServerAddress); mIPv6ServerAddress = 0; } PR_ASSERT(!mIPv6ServerAddress || addr.raw.family == PR_AF_INET6); @@ -1419,7 +1419,7 @@ nsFtpConnectionThread::R_pasv() { host.AppendInt(h3); } - nsAllocator::Free(response); + nsMemory::Free(response); // now we know where to connect our data channel rv = mSTS->CreateTransport(mIPv6ServerAddress ? mIPv6ServerAddress : host.GetBuffer(), @@ -1809,7 +1809,7 @@ nsFtpConnectionThread::StopProcessing() { mDPipe = 0; mIPv6Checked = PR_FALSE; if (mIPv6ServerAddress) { - nsAllocator::Free(mIPv6ServerAddress); + nsMemory::Free(mIPv6ServerAddress); mIPv6ServerAddress = 0; } diff --git a/mozilla/netwerk/protocol/http/src/nsBasicAuth.cpp b/mozilla/netwerk/protocol/http/src/nsBasicAuth.cpp index 4be5e5a1f9c..1cde58184dc 100644 --- a/mozilla/netwerk/protocol/http/src/nsBasicAuth.cpp +++ b/mozilla/netwerk/protocol/http/src/nsBasicAuth.cpp @@ -61,7 +61,7 @@ nsBasicAuth::Authenticate(nsIURI* i_URI, const char *protocol, if (iPass) { cPass.AssignWithConversion(iPass); } - char* tempBuff = (char *)nsAllocator::Alloc(cUser.Length() + + char* tempBuff = (char *)nsMemory::Alloc(cUser.Length() + iPass ? (cPass.Length() + 2) : 1); if (!tempBuff) @@ -74,14 +74,14 @@ nsBasicAuth::Authenticate(nsIURI* i_URI, const char *protocol, char *base64Buff = PL_Base64Encode(tempBuff, 0, nsnull); if (!base64Buff) { - nsAllocator::Free(tempBuff); + nsMemory::Free(tempBuff); return NS_ERROR_FAILURE; // ?? } nsCAutoString authString("Basic "); // , 6 + strlen(base64Buff)); authString.Append(base64Buff); *oResult = authString.ToNewCString(); PR_Free(base64Buff); - nsAllocator::Free(tempBuff); + nsMemory::Free(tempBuff); return NS_OK; } diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp index cf13abdc7e7..501d64caa2d 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -1075,7 +1075,7 @@ nsHTTPChannel::ReadFromCache() ("nsHTTPChannel::ReadFromCache [this=%x].\t" "Using cache copy for: %s\n", this, URLSpec)); - nsAllocator::Free(URLSpec); + nsMemory::Free(URLSpec); #endif /* PR_LOGGING */ // Create a cache transport to read the cached response... @@ -1550,7 +1550,7 @@ nsresult nsHTTPChannel::Redirect(const char *aNewLocation, PR_LOG(gHTTPLog, PR_LOG_ALWAYS, ("ProcessRedirect [this=%x].\tRedirecting to: %s.\n", this, newURLSpec)); - nsAllocator::Free(newURLSpec); + nsMemory::Free(newURLSpec); #endif /* PR_LOGGING */ if (checkSecurity) @@ -2159,7 +2159,7 @@ nsHTTPChannel::ProcessNotModifiedResponse(nsIStreamListener *aListener) ("nsHTTPChannel::ProcessNotModifiedResponse [this=%x].\t" "Using cache copy for: %s\n", this, URLSpec)); - nsAllocator::Free(URLSpec); + nsMemory::Free(URLSpec); #endif /* PR_LOGGING */ // Orphan the current nsHTTPServerListener instance... It will be diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPResponse.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPResponse.cpp index aa84e73525d..7f443bcfd33 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPResponse.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPResponse.cpp @@ -515,7 +515,7 @@ nsresult nsHTTPResponse::GetMaxAge(PRUint32* aMaxAge, PRBool* aMaxAgeIsPresent) return NS_OK; nsCAutoString header(cacheControlHeader); - nsAllocator::Free(cacheControlHeader); + nsMemory::Free(cacheControlHeader); PRInt32 offset; offset = header.Find("max-age=", PR_TRUE); @@ -552,7 +552,7 @@ PRBool nsHTTPResponse::IsStale(PRBool aUseHeuristicExpiration) GetHeader(nsHTTPAtoms::Cache_Control, &cacheControlHeader); if (cacheControlHeader) { nsCAutoString header(cacheControlHeader); - nsAllocator::Free(cacheControlHeader); + nsMemory::Free(cacheControlHeader); if (header.Find("no-cache", PR_TRUE) != kNotFound) return PR_TRUE; } diff --git a/mozilla/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp b/mozilla/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp index 24b2be41784..51d5028818f 100644 --- a/mozilla/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp +++ b/mozilla/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp @@ -121,7 +121,7 @@ MangleKeywordIntoHTTPURL(const char *aSpec, const char *aHTTPURL) { query = unescaped; } - nsAllocator::Free(unescaped); + nsMemory::Free(unescaped); query.Trim(" "); // pull leading/trailing spaces. @@ -129,7 +129,7 @@ MangleKeywordIntoHTTPURL(const char *aSpec, const char *aHTTPURL) { char * encQuery = nsEscape(query.GetBuffer(), url_Path); if (!encQuery) return nsnull; query = encQuery; - nsAllocator::Free(encQuery); + nsMemory::Free(encQuery); // prepend the query with the keyword url // XXX this url should come from somewhere else @@ -173,7 +173,7 @@ nsKeywordProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result) // now we have an HTTP url, give the user an HTTP channel rv = serv->NewChannel(httpSpec, nsnull, result); - nsAllocator::Free(httpSpec); + nsMemory::Free(httpSpec); return rv; } diff --git a/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index c93f2ea99c2..ea8916758b8 100644 --- a/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -21,7 +21,7 @@ */ #include "nsFTPDirListingConv.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "prlog.h" #include "nsIHTTPChannel.h" @@ -155,7 +155,7 @@ nsFTPDirListingConv::Convert(nsIInputStream *aFromStream, char *unescData = convertedData.ToNewCString(); nsUnescape(unescData); printf("::OnData() sending the following %d bytes...\n\n%s\n\n", convertedData.Length(), unescData); - nsAllocator::Free(unescData); + nsMemory::Free(unescData); #endif // DEBUG_valeski // send the converted data out. @@ -256,7 +256,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, rv = inStr->Available(&streamLen); if (NS_FAILED(rv)) return rv; - char *buffer = (char*)nsAllocator::Alloc(streamLen + 1); + char *buffer = (char*)nsMemory::Alloc(streamLen + 1); rv = inStr->Read(buffer, streamLen, &read); if (NS_FAILED(rv)) return rv; @@ -269,7 +269,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, // we have data left over from a previous OnDataAvailable() call. // combine the buffers so we don't lose any data. mBuffer.Append(buffer); - nsAllocator::Free(buffer); + nsMemory::Free(buffer); buffer = mBuffer.ToNewCString(); mBuffer.Truncate(); } @@ -295,7 +295,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, indexFormat.Append("300: "); indexFormat.Append(spec); indexFormat.Append(LF); - nsAllocator::Free(spec); + nsMemory::Free(spec); // END 300: // build up the column heading; 200: @@ -315,7 +315,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, char *unescData = indexFormat.ToNewCString(); nsUnescape(unescData); printf("::OnData() sending the following %d bytes...\n\n%s\n\n", indexFormat.Length(), unescData); - nsAllocator::Free(unescData); + nsMemory::Free(unescData); #endif // DEBUG_valeski // if there's any data left over, buffer it. @@ -325,7 +325,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, PL_strlen(line), line) ); } - nsAllocator::Free(buffer); + nsMemory::Free(buffer); // send the converted data out. nsCOMPtr inputData; @@ -668,14 +668,14 @@ nsFTPDirListingConv::ParseLSLine(char *aLine, indexEntry *aEntry) { } escName = nsEscape(aLine, url_Path); aEntry->mName = escName; - nsAllocator::Free(escName); + nsMemory::Free(escName); return NS_OK; } escName = nsEscape(ptr+1, url_Path); aEntry->mName = escName; - nsAllocator::Free(escName); + nsMemory::Free(escName); // parse size if(ptr > aLine+15) { @@ -798,7 +798,7 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCAutoString &aString) { { escName = nsEscape(line, url_Path); thisEntry->mName = escName; - nsAllocator::Free(escName); + nsMemory::Free(escName); if (thisEntry->mName.Last() == '/') { thisEntry->mType = Dir; @@ -812,7 +812,7 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCAutoString &aString) { { escName = nsEscape(line, url_Path); thisEntry->mName = escName; - nsAllocator::Free(escName); + nsMemory::Free(escName); break; // END CMS } case NT: @@ -842,14 +842,14 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCAutoString &aString) { escName = nsEscape(line, url_Path); thisEntry->mName = escName; } - nsAllocator::Free(escName); + nsMemory::Free(escName); break; // END NT } default: { escName = nsEscape(line, url_Path); thisEntry->mName = escName; - nsAllocator::Free(escName); + nsMemory::Free(escName); break; // END default (catches GENERIC, DCTS) } @@ -883,7 +883,7 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCAutoString &aString) { char *escapedDate = nsEscape(theDate.GetBuffer(), url_Path); aString.Append(escapedDate); - nsAllocator::Free(escapedDate); + nsMemory::Free(escapedDate); aString.Append(' '); diff --git a/mozilla/netwerk/streamconv/converters/nsHTTPChunkConv.cpp b/mozilla/netwerk/streamconv/converters/nsHTTPChunkConv.cpp index 8a08e5f7436..81f2273b575 100644 --- a/mozilla/netwerk/streamconv/converters/nsHTTPChunkConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsHTTPChunkConv.cpp @@ -21,7 +21,7 @@ */ #include "nsHTTPChunkConv.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "prlog.h" #include "nsIChannel.h" @@ -54,7 +54,7 @@ nsHTTPChunkConv::~nsHTTPChunkConv () NS_IF_RELEASE(mListener); if (mChunkBuffer != NULL) - nsAllocator::Free (mChunkBuffer); + nsMemory::Free (mChunkBuffer); } NS_IMETHODIMP @@ -77,8 +77,8 @@ nsHTTPChunkConv::AsyncConvertData ( else mMode = DO_CHUNKING; - nsAllocator::Free (fromStr); - nsAllocator::Free ( toStr); + nsMemory::Free (fromStr); + nsMemory::Free ( toStr); // hook ourself up with the receiving listener. mListener = aListener; @@ -129,7 +129,7 @@ nsHTTPChunkConv::OnDataAvailable ( if (mMode == DO_CHUNKING) { - mChunkBuffer = (char * )nsAllocator::Alloc (streamLen + 20); + mChunkBuffer = (char * )nsMemory::Alloc (streamLen + 20); mChunkBufferPos = sprintf (mChunkBuffer, "%x%c%c", streamLen, '\r', '\n'); rv = iStr -> Read (&mChunkBuffer[mChunkBufferPos], streamLen, &rl); @@ -176,7 +176,7 @@ nsHTTPChunkConv::OnDataAvailable ( if (mChunkBuffer != NULL) { - nsAllocator::Free (mChunkBuffer); + nsMemory::Free (mChunkBuffer); mChunkBuffer = NULL; } @@ -222,7 +222,7 @@ nsHTTPChunkConv::OnDataAvailable ( if (mChunkBuffer != NULL) { - nsAllocator::Free (mChunkBuffer); + nsMemory::Free (mChunkBuffer); mChunkBuffer = NULL; } } @@ -267,7 +267,7 @@ nsHTTPChunkConv::OnDataAvailable ( { if (mChunkBufferLength > 0) { - mChunkBuffer = (char * )nsAllocator::Alloc (mChunkBufferLength + 1); + mChunkBuffer = (char * )nsMemory::Alloc (mChunkBufferLength + 1); mState = CHUNK_STATE_DATA; } else diff --git a/mozilla/netwerk/streamconv/converters/nsHTTPCompressConv.cpp b/mozilla/netwerk/streamconv/converters/nsHTTPCompressConv.cpp index 21d8cbdb02f..3ef4f9d4590 100644 --- a/mozilla/netwerk/streamconv/converters/nsHTTPCompressConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsHTTPCompressConv.cpp @@ -21,7 +21,7 @@ */ #include "nsHTTPCompressConv.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "prlog.h" #include "nsIChannel.h" @@ -50,10 +50,10 @@ nsHTTPCompressConv::~nsHTTPCompressConv () NS_IF_RELEASE(mListener); if (mInpBuffer != NULL) - nsAllocator::Free (mInpBuffer); + nsMemory::Free (mInpBuffer); if (mOutBuffer != NULL) - nsAllocator::Free (mOutBuffer); + nsMemory::Free (mOutBuffer); } NS_IMETHODIMP @@ -82,8 +82,8 @@ nsHTTPCompressConv::AsyncConvertData ( if (!PL_strncasecmp (fromStr, HTTP_DEFLATE_TYPE, strlen (HTTP_DEFLATE_TYPE))) mMode = HTTP_COMPRESS_DEFLATE; - nsAllocator::Free (fromStr); - nsAllocator::Free ( toStr); + nsMemory::Free (fromStr); + nsMemory::Free ( toStr); // hook ourself up with the receiving listener. mListener = aListener; @@ -140,20 +140,20 @@ nsHTTPCompressConv::OnDataAvailable ( if (mInpBuffer != NULL && streamLen > mInpBufferLen) { - mInpBuffer = (unsigned char *) nsAllocator::Realloc (mInpBuffer, mInpBufferLen = streamLen); + mInpBuffer = (unsigned char *) nsMemory::Realloc (mInpBuffer, mInpBufferLen = streamLen); if (mOutBufferLen < streamLen * 2) - mOutBuffer = (unsigned char *) nsAllocator::Realloc (mOutBuffer, mOutBufferLen = streamLen * 3); + mOutBuffer = (unsigned char *) nsMemory::Realloc (mOutBuffer, mOutBufferLen = streamLen * 3); if (mInpBuffer == NULL || mOutBuffer == NULL) return NS_ERROR_OUT_OF_MEMORY; } if (mInpBuffer == NULL) - mInpBuffer = (unsigned char *) nsAllocator::Alloc (mInpBufferLen = streamLen); + mInpBuffer = (unsigned char *) nsMemory::Alloc (mInpBufferLen = streamLen); if (mOutBuffer == NULL) - mOutBuffer = (unsigned char *) nsAllocator::Alloc (mOutBufferLen = streamLen * 3); + mOutBuffer = (unsigned char *) nsMemory::Alloc (mOutBufferLen = streamLen * 3); if (mInpBuffer == NULL || mOutBuffer == NULL) return NS_ERROR_OUT_OF_MEMORY; @@ -169,7 +169,7 @@ nsHTTPCompressConv::OnDataAvailable ( int code = uncompress (mOutBuffer, &uLen, mInpBuffer, mInpBufferLen); if (code == Z_BUF_ERROR) { - mOutBuffer = (unsigned char *) nsAllocator::Realloc (mOutBuffer, mOutBufferLen *= 3); + mOutBuffer = (unsigned char *) nsMemory::Realloc (mOutBuffer, mOutBufferLen *= 3); if (mOutBuffer == NULL) return NS_ERROR_OUT_OF_MEMORY; @@ -293,7 +293,7 @@ nsHTTPCompressConv::do_OnDataAvailable (nsIChannel *aChannel, nsISupports *aCont nsCOMPtr convertedStreamSup; - char * lBuf = (char *) nsAllocator::Alloc (aCount); + char * lBuf = (char *) nsMemory::Alloc (aCount); if (lBuf == NULL) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp index cd9b237d66d..f918f97dc8b 100644 --- a/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -21,7 +21,7 @@ */ #include "nsMultiMixedConv.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "plstr.h" #include "nsIHTTPChannel.h" #include "nsIAtom.h" @@ -65,7 +65,7 @@ nsMultiMixedConv::AsyncConvertData(const PRUnichar *aFromType, const PRUnichar * return NS_OK; } -#define ERR_OUT { nsAllocator::Free(buffer); return rv; } +#define ERR_OUT { nsMemory::Free(buffer); return rv; } // nsIStreamListener implementation NS_IMETHODIMP @@ -77,7 +77,7 @@ nsMultiMixedConv::OnDataAvailable(nsIChannel *channel, nsISupports *context, NS_ASSERTION(channel, "multimixed converter needs a channel"); - buffer = (char*)nsAllocator::Alloc(bufLen); + buffer = (char*)nsMemory::Alloc(bufLen); if (!buffer) ERR_OUT rv = inStr->Read(buffer, bufLen, &read); @@ -86,16 +86,16 @@ nsMultiMixedConv::OnDataAvailable(nsIChannel *channel, nsISupports *context, if (mBufLen) { // incorporate any buffered data into the parsing - char *tmp = (char*)nsAllocator::Alloc(mBufLen + bufLen); + char *tmp = (char*)nsMemory::Alloc(mBufLen + bufLen); if (!tmp) { - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return NS_ERROR_OUT_OF_MEMORY; } nsCRT::memcpy(tmp, mBuffer, mBufLen); - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBuffer = nsnull; nsCRT::memcpy(tmp+mBufLen, buffer, bufLen); - nsAllocator::Free(buffer); + nsMemory::Free(buffer); buffer = tmp; bufLen += mBufLen; mBufLen = 0; @@ -122,7 +122,7 @@ nsMultiMixedConv::OnDataAvailable(nsIChannel *channel, nsISupports *context, // This was the last delimiter so we can stop processing bufLen = token - cursor; rv = SendData(cursor, bufLen); - nsAllocator::Free(buffer); + nsMemory::Free(buffer); buffer = nsnull; bufLen = 0; return SendStop(); @@ -196,7 +196,7 @@ nsMultiMixedConv::OnDataAvailable(nsIChannel *channel, nsISupports *context, if (NS_FAILED(rv)) ERR_OUT } - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return rv; } @@ -260,7 +260,7 @@ nsMultiMixedConv::OnStopRequest(nsIChannel *channel, nsISupports *ctxt, if (mBufLen > 0) { rv = SendData(mBuffer, mBufLen); if (NS_FAILED(rv)) return rv; - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBuffer = nsnull; mBufLen = 0; } @@ -277,7 +277,7 @@ nsMultiMixedConv::OnStopRequest(nsIChannel *channel, nsISupports *ctxt, if (mBufLen > 0 && mBuffer) { SendData(mBuffer, mBufLen); - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBuffer = nsnull; mBufLen = 0; rv = SendStop (); @@ -333,7 +333,7 @@ nsresult nsMultiMixedConv::BufferData(char *aData, PRUint32 aLen) { NS_ASSERTION(!mBuffer, "trying to over-write buffer"); - char *buffer = (char*)nsAllocator::Alloc(aLen); + char *buffer = (char*)nsMemory::Alloc(aLen); if (!buffer) return NS_ERROR_OUT_OF_MEMORY; nsCRT::memcpy(buffer, aData, aLen); @@ -403,7 +403,7 @@ nsMultiMixedConv::SendData(char *aBuffer, PRUint32 aLen) { // headers after a token to delineate a new part. This is required. If // the server's not sending those headers, the server's broken. NS_ASSERTION(mPartChannel, "our channel went away :-("); - char *tmp = (char*)nsAllocator::Alloc(aLen); // byteArray stream owns this mem + char *tmp = (char*)nsMemory::Alloc(aLen); // byteArray stream owns this mem if (!tmp) return NS_ERROR_OUT_OF_MEMORY; nsCRT::memcpy(tmp, aBuffer, aLen); @@ -412,7 +412,7 @@ nsMultiMixedConv::SendData(char *aBuffer, PRUint32 aLen) { rv = NS_NewByteArrayInputStream(getter_AddRefs(byteArrayStream), tmp, aLen); if (NS_FAILED(rv)) { - nsAllocator::Free(tmp); + nsMemory::Free(tmp); return rv; } diff --git a/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp b/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp index 99c60ea6b5c..b9f2972e6ee 100644 --- a/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp @@ -133,7 +133,7 @@ nsTXTToHTMLConv::OnDataAvailable(nsIChannel *aChannel, nsISupports *aContext, nsresult rv = NS_OK; nsString pushBuffer; PRUint32 amtRead = 0; - char *buffer = (char*)nsAllocator::Alloc(aCount+1); + char *buffer = (char*)nsMemory::Alloc(aCount+1); if (!buffer) return NS_ERROR_OUT_OF_MEMORY; do { @@ -174,7 +174,7 @@ nsTXTToHTMLConv::OnDataAvailable(nsIChannel *aChannel, nsISupports *aContext, nsCOMPtr inputDataSup; rv = NS_NewStringInputStream(getter_AddRefs(inputDataSup), pushBuffer); if (NS_FAILED(rv)) { - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return rv; } @@ -183,13 +183,13 @@ nsTXTToHTMLConv::OnDataAvailable(nsIChannel *aChannel, nsISupports *aContext, rv = mListener->OnDataAvailable(aChannel, aContext, inputData, 0, pushBuffer.Length()); if (NS_FAILED(rv)) { - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return rv; } } } while (amtRead < aCount); - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return rv; } // nsTXTToHTMLConv methods diff --git a/mozilla/netwerk/streamconv/src/nsStreamConverterService.cpp b/mozilla/netwerk/streamconv/src/nsStreamConverterService.cpp index 6eca5557521..569ff79b982 100644 --- a/mozilla/netwerk/streamconv/src/nsStreamConverterService.cpp +++ b/mozilla/netwerk/streamconv/src/nsStreamConverterService.cpp @@ -391,7 +391,7 @@ nsStreamConverterService::FindConverter(const char *aProgID, nsCStringArray **aE curVertexAtom->ToString(curVertexStr); char * curVertexCString = curVertexStr.ToNewCString(); nsStringKey *curVertex = new nsStringKey(curVertexCString); - nsAllocator::Free(curVertexCString); + nsMemory::Free(curVertexCString); SCTableData *data3 = (SCTableData*)lBFSTable.Get(curVertex); BFSState *curVertexState = (BFSState*)data3->data; @@ -563,8 +563,8 @@ nsStreamConverterService::Convert(nsIInputStream *aFromStream, PRUnichar *fromUni = fromStr.ToNewUnicode(); PRUnichar *toUni = toStr.ToNewUnicode(); rv = conv->Convert(dataToConvert, fromUni, toUni, aContext, &convertedData); - nsAllocator::Free(fromUni); - nsAllocator::Free(toUni); + nsMemory::Free(fromUni); + nsMemory::Free(toUni); NS_RELEASE(conv); NS_RELEASE(dataToConvert); dataToConvert = convertedData; @@ -666,8 +666,8 @@ nsStreamConverterService::AsyncConvertData(const PRUnichar *aFromType, PRUnichar *toStrUni = toStr.ToNewUnicode(); rv = converter->AsyncConvertData(fromStrUni, toStrUni, forwardListener, aContext); - nsAllocator::Free(fromStrUni); - nsAllocator::Free(toStrUni); + nsMemory::Free(fromStrUni); + nsMemory::Free(toStrUni); if (NS_FAILED(rv)) { delete converterChain; return rv; diff --git a/mozilla/netwerk/streamconv/test/Converters.cpp b/mozilla/netwerk/streamconv/test/Converters.cpp index 7fb2ecfa455..6f4f07143f7 100644 --- a/mozilla/netwerk/streamconv/test/Converters.cpp +++ b/mozilla/netwerk/streamconv/test/Converters.cpp @@ -29,7 +29,7 @@ TestConverter::Convert(nsIInputStream *aFromStream, nsString to(aToType); char *toMIME = to.ToNewCString(); char toChar = *toMIME; - nsAllocator::Free(toMIME); + nsMemory::Free(toMIME); for (PRUint32 i = 0; i < read; i++) buf[i] = toChar; diff --git a/mozilla/netwerk/streamconv/test/TestStreamConv.cpp b/mozilla/netwerk/streamconv/test/TestStreamConv.cpp index a56a636f2d0..d81674f3f81 100644 --- a/mozilla/netwerk/streamconv/test/TestStreamConv.cpp +++ b/mozilla/netwerk/streamconv/test/TestStreamConv.cpp @@ -88,7 +88,7 @@ public: rv = inStr->Available(&len); if (NS_FAILED(rv)) return rv; - char *buffer = (char*)nsAllocator::Alloc(len + 1); + char *buffer = (char*)nsMemory::Alloc(len + 1); if (!buffer) return NS_ERROR_OUT_OF_MEMORY; rv = inStr->Read(buffer, len, &read); @@ -96,7 +96,7 @@ public: if (NS_SUCCEEDED(rv)) { printf("CONTEXT %p: Received %u bytes and the following data: \n %s\n\n", ctxt, read, buffer); } - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return NS_OK; } diff --git a/mozilla/netwerk/test/TestCacheMgr.cpp b/mozilla/netwerk/test/TestCacheMgr.cpp index 0c56f44264e..ac3ac2ab93c 100644 --- a/mozilla/netwerk/test/TestCacheMgr.cpp +++ b/mozilla/netwerk/test/TestCacheMgr.cpp @@ -364,7 +364,7 @@ TestRead(nsINetDataCacheManager *aCache, PRUint32 aFlags) NS_ASSERTION(NS_SUCCEEDED(rv) && !memcmp(storedUriKey, &uriCacheKey[0], sizeof uriCacheKey), "nsICachedNetData::GetKey failed"); - nsAllocator::Free(storedUriKey); + nsMemory::Free(storedUriKey); // Test GetSecondaryKey() method PRUint32 storedSecondaryKeyLength; diff --git a/mozilla/netwerk/test/TestFileTransport.cpp b/mozilla/netwerk/test/TestFileTransport.cpp index 45f2d126d22..329bf4ad0b1 100644 --- a/mozilla/netwerk/test/TestFileTransport.cpp +++ b/mozilla/netwerk/test/TestFileTransport.cpp @@ -25,7 +25,7 @@ #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsString.h" #include "nsIFileStreams.h" #include "nsIStreamListener.h" @@ -90,7 +90,7 @@ public: if (name == nsnull) return NS_ERROR_OUT_OF_MEMORY; nsAutoString str; str.AssignWithConversion(name); - nsAllocator::Free(name); + nsMemory::Free(name); str.AppendWithConversion(".bak"); nsFileSpec spec(origFile); spec.SetLeafName(str); diff --git a/mozilla/netwerk/test/TestMakeAbs.cpp b/mozilla/netwerk/test/TestMakeAbs.cpp index 798f100b5a7..6f3270e8e00 100644 --- a/mozilla/netwerk/test/TestMakeAbs.cpp +++ b/mozilla/netwerk/test/TestMakeAbs.cpp @@ -75,10 +75,10 @@ main(int argc, char* argv[]) while (i++ < cycles) { rv = ServiceMakeAbsolute(uri, rel, &absURLString); if (NS_FAILED(rv)) return rv; - nsAllocator::Free(absURLString); + nsMemory::Free(absURLString); rv = URLMakeAbsolute(uri, rel, &absURLString); - nsAllocator::Free(absURLString); + nsMemory::Free(absURLString); } return rv; diff --git a/mozilla/netwerk/test/TestRawCache.cpp b/mozilla/netwerk/test/TestRawCache.cpp index 1ac2dd091bb..8f79d9c32f3 100644 --- a/mozilla/netwerk/test/TestRawCache.cpp +++ b/mozilla/netwerk/test/TestRawCache.cpp @@ -340,7 +340,7 @@ TestRecordID(nsINetDataCache *cache) match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); delete randomStream; } return NS_OK; @@ -403,7 +403,7 @@ TestEnumeration(nsINetDataCache *cache) NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't get record meta-data"); match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); delete randomStream; } @@ -445,7 +445,7 @@ TestRead(nsINetDataCache *cache) NS_ASSERTION(NS_SUCCEEDED(rv), " "); match = randomStream->Match(metaData, metaDataLength); NS_ASSERTION(match, "Meta-data corrupted or incorrect"); - nsAllocator::Free(metaData); + nsMemory::Free(metaData); // Test GetKey() method rv = record->GetKey(&storedCacheKeyLength, &storedCacheKey); @@ -453,7 +453,7 @@ TestRead(nsINetDataCache *cache) (storedCacheKeyLength == sizeof cacheKey) && !memcmp(storedCacheKey, &cacheKey[0], sizeof cacheKey), "nsINetDataCacheRecord::GetKey failed"); - nsAllocator::Free(storedCacheKey); + nsMemory::Free(storedCacheKey); PRUint32 expectedStreamLength = randomStream->Next() % MAX_CONTENT_LENGTH; diff --git a/mozilla/netwerk/test/TestWriteStream.cpp b/mozilla/netwerk/test/TestWriteStream.cpp index 32f89f0fc7f..fa632680e54 100644 --- a/mozilla/netwerk/test/TestWriteStream.cpp +++ b/mozilla/netwerk/test/TestWriteStream.cpp @@ -25,7 +25,7 @@ #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsString.h" #include "nsIFileStream.h" #include "nsIStreamListener.h" diff --git a/mozilla/netwerk/test/nettest.cpp b/mozilla/netwerk/test/nettest.cpp index c01c879d185..fa4e8e40097 100644 --- a/mozilla/netwerk/test/nettest.cpp +++ b/mozilla/netwerk/test/nettest.cpp @@ -141,7 +141,7 @@ NS_IMETHODIMP TestConsumer::OnStopRequest(nsISupports *context, nsIChannel* chan mUrl->ToNewCString(&url); printf("Unable to load URL %s\n", url); - nsAllocator::Free(url); + nsMemory::Free(url); } urlLoaded = 1; @@ -270,7 +270,7 @@ int main(int argc, char **argv) pURL->ToNewCString(&url); printf("Unable to load URL %s\n", url); - nsAllocator::Free(url); + nsMemory::Free(url); urlLoaded = 1; } } diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index 737fb566968..89043f7b895 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -157,7 +157,7 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream, nsHTMLContentSinkStream::~nsHTMLContentSinkStream() { if (mBuffer) - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); } /** diff --git a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 4646d4c224b..8f292e275fe 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -890,9 +890,9 @@ void nsHTMLToTXTSinkStream::EnsureBufferSize(PRInt32 aNewSize) { if (mBufferSize < aNewSize) { - nsAllocator::Free(mBuffer); + nsMemory::Free(mBuffer); mBufferSize = 2*aNewSize+1; // make the twice as large - mBuffer = NS_STATIC_CAST(char*, nsAllocator::Alloc(mBufferSize)); + mBuffer = NS_STATIC_CAST(char*, nsMemory::Alloc(mBufferSize)); if(mBuffer){ mBuffer[0] = 0; mBufferLength = 0; @@ -1208,7 +1208,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString) #ifdef DEBUG_wrapping char* foo = aString.ToNewCString(); printf("Write(%s): wrap col = %d, mColPos = %d\n", foo, mWrapColumn, mColPos); - nsAllocator::Free(foo); + nsMemory::Free(foo); #endif PRInt32 bol = 0; @@ -1297,7 +1297,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString) foo = remaining.ToNewCString(); // printf("Next line: bol = %d, newlinepos = %d, totLen = %d, string = '%s'\n", // bol, nextpos, totLen, foo); - nsAllocator::Free(foo); + nsMemory::Free(foo); #endif if(nextpos < 0) { diff --git a/mozilla/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp b/mozilla/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp index 66bcb3d12a0..666b7a2fa6a 100644 --- a/mozilla/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp +++ b/mozilla/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp @@ -33,7 +33,7 @@ #include "npapi.h" #include "nsIPluginManager2.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsLiveConnect.h" #include "nsIEventHandler.h" #include "nsplugin.h" @@ -59,7 +59,7 @@ #pragma mark CPluginManager -class CPluginManager : public nsIPluginManager2, public nsIServiceManager, public nsIAllocator { +class CPluginManager : public nsIPluginManager2, public nsIServiceManager, public nsIMemory { public: // Need an operator new for this. void* operator new(size_t size) { return ::NPN_MemAlloc(size); } @@ -1885,7 +1885,7 @@ CPluginManager::GetService(const nsCID& aClass, const nsIID& aIID, nsISupports* *result, nsIShutdownListener* shutdownListener) { - // the only service we support currently is nsIAllocator. + // the only service we support currently is nsIMemory. if (aClass.Equals(kPluginManagerCID) || aClass.Equals(kAllocatorCID)) { return QueryInterface(aIID, (void**) result); } @@ -1908,7 +1908,7 @@ CPluginManager::ReleaseService(const nsCID& aClass, nsISupports* service, } ////////////////////////////// -// nsIAllocator methods. +// nsIMemory methods. ////////////////////////////// NS_METHOD_(void*) @@ -1971,8 +1971,8 @@ CPluginManager::QueryInterface(const nsIID& iid, void** ptr) AddRef(); return NS_OK; } - if (iid.Equals(NS_GET_IID(nsIAllocator))) { - *ptr = (void*) (nsIAllocator*)this; + if (iid.Equals(NS_GET_IID(nsIMemory))) { + *ptr = (void*) (nsIMemory*)this; AddRef(); return NS_OK; } diff --git a/mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp b/mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp index ded473b73fc..470462f2c77 100644 --- a/mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp +++ b/mozilla/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp @@ -35,7 +35,7 @@ #include "EmbeddedFramePluginInstance.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsRepository.h" #include "nsIJVMManager.h" #include "nsIJVMPluginTagInfo.h" @@ -55,7 +55,7 @@ extern nsIPluginManager* thePluginManager; // now in badaptor.cpp. extern nsIPlugin* thePlugin; nsIPluginManager2* thePluginManager2 = NULL; -nsIAllocator* theMemoryAllocator = NULL; // should also be provided by badaptor.cpp. +nsIMemory* theMemoryAllocator = NULL; // should also be provided by badaptor.cpp. FSSpec thePluginSpec; short thePluginRefnum = -1; @@ -84,7 +84,7 @@ nsresult NSGetFactory(nsISupports* serviceManager, const nsCID &aClass, const ch // Our global operator new wants to use nsIMalloc to do all of its allocation. // This should be available from the Service Manager. - if (theServiceManager->GetService(kAllocatorCID, NS_GET_IID(nsIAllocator), (nsISupports**)&theMemoryAllocator) != NS_OK) + if (theServiceManager->GetService(kAllocatorCID, NS_GET_IID(nsIMemory), (nsISupports**)&theMemoryAllocator) != NS_OK) return NS_ERROR_FAILURE; } diff --git a/mozilla/plugin/oji/MRJ/plugin/Source/PluginNew.cpp b/mozilla/plugin/oji/MRJ/plugin/Source/PluginNew.cpp index 7f4f38d364d..1d599dbd4bc 100644 --- a/mozilla/plugin/oji/MRJ/plugin/Source/PluginNew.cpp +++ b/mozilla/plugin/oji/MRJ/plugin/Source/PluginNew.cpp @@ -30,13 +30,13 @@ #include #include "jni.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" // Warning: this forces all C++ allocation to go through Navigator's memory allocation // Routines. As such, static constructors that use operator new may not work. This can // be fixed if we delay static construction (see the call to __InitCode__() in npmac.cpp). -extern nsIAllocator* theMemoryAllocator; +extern nsIMemory* theMemoryAllocator; void* operator new(size_t size) { diff --git a/mozilla/profile/Acctidl/nsAccountServices.cpp b/mozilla/profile/Acctidl/nsAccountServices.cpp index 2521c68c46e..7d3673ab417 100644 --- a/mozilla/profile/Acctidl/nsAccountServices.cpp +++ b/mozilla/profile/Acctidl/nsAccountServices.cpp @@ -31,7 +31,7 @@ #include "windows.h" #include "nscore.h" #include "nsIAccountServices.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" #include "nsIAccount.h" diff --git a/mozilla/rdf/base/src/nsRDFService.cpp b/mozilla/rdf/base/src/nsRDFService.cpp index a138c6f0194..19eaf44e385 100644 --- a/mozilla/rdf/base/src/nsRDFService.cpp +++ b/mozilla/rdf/base/src/nsRDFService.cpp @@ -48,7 +48,7 @@ */ #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIAtom.h" #include "nsIComponentManager.h" #include "nsIRDFDataSource.h" @@ -629,7 +629,7 @@ RDFServiceImpl::GetResource(const char* aURI, nsIRDFResource** aResource) char buf[128]; char* progID = buf; if (len >= PRInt32(sizeof buf)) - progID = (char *)nsAllocator::Alloc(len + 1); + progID = (char *)nsMemory::Alloc(len + 1); if (progID == nsnull) return NS_ERROR_OUT_OF_MEMORY; @@ -1082,7 +1082,7 @@ RDFServiceImpl::GetDataSource(const char* aURI, nsIRDFDataSource** aDataSource) char buf[64]; char* progID = buf, *p; if (progIDStr.Length() >= PRInt32(sizeof buf)) - progID = (char *)nsAllocator::Alloc(progIDStr.Length() + 1); + progID = (char *)nsMemory::Alloc(progIDStr.Length() + 1); if (progID == nsnull) return NS_ERROR_OUT_OF_MEMORY; @@ -1228,7 +1228,7 @@ RDFServiceImpl::UnregisterLiteral(nsIRDFLiteral* aLiteral) return NS_OK; #ifndef REUSE_LITERAL_VALUE_AS_KEY - nsAllocator::Free((void*) (*hep)->key); + nsMemory::Free((void*) (*hep)->key); #endif // N.B. that we _don't_ release the literal: we only held a weak diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index 10ddf5e3c20..3d993869471 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -727,7 +727,7 @@ NS_IMETHODIMP nsChromeRegistry::GetStyleSheets(nsIURI *aChromeURL, nsISupportsAr url->GetSpec(&str); LoadStyleSheet(getter_AddRefs(sheet), str); (*aResult)->AppendElement(sheet); - nsAllocator::Free(str); + nsMemory::Free(str); } sheets->HasMoreElements(&hasMore); } @@ -763,7 +763,7 @@ NS_IMETHODIMP nsChromeRegistry::GetDynamicInfo(nsIURI *aChromeURL, PRBool aIsOve NS_ERROR("Unable to retrieve the resource corresponding to the chrome skin or content."); return rv; } - nsAllocator::Free(lookup); + nsMemory::Free(lookup); nsCOMPtr installArcs; nsCOMPtr profileArcs; @@ -1227,7 +1227,7 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS } arcs->HasMoreElements(&moreElements); } - nsAllocator::Free(value); + nsMemory::Free(value); return NS_OK; } diff --git a/mozilla/rdf/tests/domds/nsRDFDOMDataSource.cpp b/mozilla/rdf/tests/domds/nsRDFDOMDataSource.cpp index 46b81a140b5..1737158a1f8 100644 --- a/mozilla/rdf/tests/domds/nsRDFDOMDataSource.cpp +++ b/mozilla/rdf/tests/domds/nsRDFDOMDataSource.cpp @@ -984,7 +984,7 @@ nsRDFDOMDataSource::createLiteral(nsString& str, nsIRDFNode **aResult) PRUnichar* uniStr = str.ToNewUnicode(); rv = getRDFService()->GetLiteral(uniStr, getter_AddRefs(literal)); - nsAllocator::Free(uniStr); + nsMemory::Free(uniStr); *aResult = literal; NS_IF_ADDREF(*aResult); diff --git a/mozilla/rdf/tests/domds/nsRDFDOMViewerUtils.cpp b/mozilla/rdf/tests/domds/nsRDFDOMViewerUtils.cpp index d6f6c2ec14d..69c4044cc92 100644 --- a/mozilla/rdf/tests/domds/nsRDFDOMViewerUtils.cpp +++ b/mozilla/rdf/tests/domds/nsRDFDOMViewerUtils.cpp @@ -57,7 +57,7 @@ nsDOMViewerObject::SetTargetLiteral(nsIRDFResource *aProperty, PRUnichar* uniStr = str.ToNewUnicode(); nsCOMPtr literal; rv = rdf->GetLiteral(uniStr, getter_AddRefs(literal)); - nsAllocator::Free(uniStr); + nsMemory::Free(uniStr); SetTarget(aProperty, literal); return NS_OK; diff --git a/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp b/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp index 1769b34ffa3..83218210c5e 100644 --- a/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp +++ b/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp @@ -98,7 +98,7 @@ static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID); NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); -#include "nsIAllocator.h" // for the CID +#include "nsIMemory.h" // for the CID static nsresult SetupRegistry(void) @@ -120,12 +120,12 @@ SetupRegistry(void) nsComponentManager::RegisterComponent(kNameSpaceManagerCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE); // xpcom - static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); + static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); static NS_DEFINE_CID(kEventQueueCID, NS_EVENTQUEUE_CID); nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponent(kMemoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); return NS_OK; } diff --git a/mozilla/rdf/util/src/nsRDFResource.cpp b/mozilla/rdf/util/src/nsRDFResource.cpp index 79e485ebf6b..41308549257 100644 --- a/mozilla/rdf/util/src/nsRDFResource.cpp +++ b/mozilla/rdf/util/src/nsRDFResource.cpp @@ -104,7 +104,7 @@ nsRDFResource::Init(const char* aURI) if (! aURI) return NS_ERROR_NULL_POINTER; - if (! (mURI = (char *)nsAllocator::Alloc(nsCRT::strlen(aURI) + 1))) + if (! (mURI = (char *)nsMemory::Alloc(nsCRT::strlen(aURI) + 1))) return NS_ERROR_OUT_OF_MEMORY; PL_strcpy(mURI, aURI); diff --git a/mozilla/string/obsolete/nsStr.cpp b/mozilla/string/obsolete/nsStr.cpp index 906267b01f8..823aa3e95a2 100644 --- a/mozilla/string/obsolete/nsStr.cpp +++ b/mozilla/string/obsolete/nsStr.cpp @@ -664,7 +664,7 @@ PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) { aDest.mCapacity=theNewCapacity++; PRUint32 theSize=(theNewCapacity< #include #include "plhash.h" @@ -493,8 +493,8 @@ inline void AddNullTerminator(nsStr& aDest) { * Return the given buffer to the heap manager. Calls allocator::Free() * @return string length */ -inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); } -inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); } +inline void Recycle( char* aBuffer) { nsMemory::Free(aBuffer); } +inline void Recycle( PRUnichar* aBuffer) { nsMemory::Free(aBuffer); } /** * This method is used to access a given char in the given string diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 38f5624e0de..07e82de4e98 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -662,7 +662,7 @@ char* nsCString::ToNewCString() const { * @return ptr to new ascii string */ PRUnichar* nsCString::ToNewUnicode() const { - PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsAllocator::Alloc(sizeof(PRUnichar) * (mLength + 1))); + PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsMemory::Alloc(sizeof(PRUnichar) * (mLength + 1))); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsAutoString temp(desc); diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index af9d4aff01f..05b32a47dda 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -719,7 +719,7 @@ nsString* nsString::ToNewString() const { * @return ptr to new ascii string */ char* nsString::ToNewCString() const { - char* result = NS_STATIC_CAST(char*, nsAllocator::Alloc(mLength + 1)); + char* result = NS_STATIC_CAST(char*, nsMemory::Alloc(mLength + 1)); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsCAutoString temp(desc); diff --git a/mozilla/string/obsolete/nsXPIDLString.cpp b/mozilla/string/obsolete/nsXPIDLString.cpp index 4e23edce83d..1ef8e962683 100644 --- a/mozilla/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/string/obsolete/nsXPIDLString.cpp @@ -21,14 +21,14 @@ */ #include "nsDebug.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsXPIDLString.h" #include "plstr.h" // If the allocator changes, fix it here. -#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar))) -#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char))) -#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr)) +#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsMemory::Alloc((__len) * sizeof(PRUnichar))) +#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsMemory::Alloc((__len) * sizeof(char))) +#define XPIDL_FREE(__ptr) (nsMemory::Free(__ptr)) //////////////////////////////////////////////////////////////////////// // nsXPIDLString diff --git a/mozilla/string/obsolete/nsXPIDLString.h b/mozilla/string/obsolete/nsXPIDLString.h index 3ac35b130e8..3cd75524e17 100644 --- a/mozilla/string/obsolete/nsXPIDLString.h +++ b/mozilla/string/obsolete/nsXPIDLString.h @@ -48,7 +48,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - nsAllocator::Free(bar); + nsMemory::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -62,7 +62,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to nsAllocator::Free(). + // no need to remember to nsMemory::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an diff --git a/mozilla/uriloader/exthandler/nsMIMEInfoImpl.cpp b/mozilla/uriloader/exthandler/nsMIMEInfoImpl.cpp index 4dfca87faf0..3b1359102f1 100644 --- a/mozilla/uriloader/exthandler/nsMIMEInfoImpl.cpp +++ b/mozilla/uriloader/exthandler/nsMIMEInfoImpl.cpp @@ -45,7 +45,7 @@ nsMIMEInfoImpl::GetFileExtensions(PRUint32 *elementCount, char ***extensions) { *elementCount = mExtensions.Count(); if (*elementCount < 1) return NS_OK;; - char **_retExts = (char**)nsAllocator::Alloc((*elementCount)*2*sizeof(char*)); + char **_retExts = (char**)nsMemory::Alloc((*elementCount)*2*sizeof(char*)); if (!_retExts) return NS_ERROR_OUT_OF_MEMORY; for (PRUint8 i=0; i < *elementCount; i++) { diff --git a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp index 4d49c8fcaaf..6d4e82eca8e 100644 --- a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp @@ -40,7 +40,7 @@ #include "nsIObserverService.h" #include "nsIObserver.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsIEventQueue.h" #include "nsIEventQueueService.h" #include "nsIGenericFactory.h" diff --git a/mozilla/webshell/tests/viewer/nsThrobber.cpp b/mozilla/webshell/tests/viewer/nsThrobber.cpp index 87e8f7b411b..1dac7ef59b7 100644 --- a/mozilla/webshell/tests/viewer/nsThrobber.cpp +++ b/mozilla/webshell/tests/viewer/nsThrobber.cpp @@ -361,7 +361,7 @@ nsThrobber::LoadThrobberImages(const nsString& aFileNameMask, PRInt32 aNumImages } if (nsnull != mask) - nsAllocator::Free(mask); + nsMemory::Free(mask); mWidget->Invalidate(PR_TRUE); diff --git a/mozilla/widget/public/nsIAppShell.idl b/mozilla/widget/public/nsIAppShell.idl index b0110b5f48c..064351a467c 100644 --- a/mozilla/widget/public/nsIAppShell.idl +++ b/mozilla/widget/public/nsIAppShell.idl @@ -29,7 +29,7 @@ native int(int); [ptr] native nsIEventQueue(nsIEventQueue); [ptr] native UndefinednsIWidget(nsIWidget); [ref] native PRBoolRef(PRBool); -[ref] native voidStarRef(void *); +[ref] native voidPtrRef(void *); %{ C++ #include "nsIEventQueue.h" @@ -95,13 +95,13 @@ interface nsIAppShell : nsISupports * After event dispatch execute app specific code */ - void GetNativeEvent(in PRBoolRef aRealEvent, in voidStarRef aEvent); + void GetNativeEvent(in PRBoolRef aRealEvent, in voidPtrRef aEvent); /** * After event dispatch execute app specific code */ - void DispatchNativeEvent(in PRBool aRealEvent, in voidStar aEvent); + void DispatchNativeEvent(in PRBool aRealEvent, in voidPtr aEvent); /** * After event dispatch execute app specific code diff --git a/mozilla/widget/public/nsIBaseWindow.idl b/mozilla/widget/public/nsIBaseWindow.idl index 802f468ef3c..3de28ffde85 100644 --- a/mozilla/widget/public/nsIBaseWindow.idl +++ b/mozilla/widget/public/nsIBaseWindow.idl @@ -29,7 +29,7 @@ #include "nsIWidget.h" %} -typedef voidStar nativeWindow; +typedef voidPtr nativeWindow; /** * The nsIBaseWindow describes a generic window and basic operations that diff --git a/mozilla/widget/public/nsIWidget.idl b/mozilla/widget/public/nsIWidget.idl index b1259f31477..1a435f7fad9 100644 --- a/mozilla/widget/public/nsIWidget.idl +++ b/mozilla/widget/public/nsIWidget.idl @@ -82,7 +82,7 @@ typedef long nsCursor; * including native window system types and api's. This is necessary * to ensure cross-platform code. */ -typedef voidStar nsNativeWidget; +typedef voidPtr nsNativeWidget; %{ C++ @@ -192,7 +192,7 @@ interface nsIWidget : nsISupports /** * Get some kind of native data */ - voidStar getNativeData(in PRUint32 aDataType); + voidPtr getNativeData(in PRUint32 aDataType); /** * Move this widget. @@ -491,7 +491,7 @@ interface nsIWidget : nsISupports * Accessor functions to get and set the client data associated with the * widget. */ - attribute voidStar clientData; + attribute voidPtr clientData; /** * Return an nsEnumerator over the children of this widget. diff --git a/mozilla/widget/src/beos/nsSound.cpp b/mozilla/widget/src/beos/nsSound.cpp index c257e9bee07..0dac5953ce2 100644 --- a/mozilla/widget/src/beos/nsSound.cpp +++ b/mozilla/widget/src/beos/nsSound.cpp @@ -23,7 +23,7 @@ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" diff --git a/mozilla/widget/src/gtk/nsClipboard.cpp b/mozilla/widget/src/gtk/nsClipboard.cpp index 23e15dd0880..1d9510047b9 100644 --- a/mozilla/widget/src/gtk/nsClipboard.cpp +++ b/mozilla/widget/src/gtk/nsClipboard.cpp @@ -146,7 +146,7 @@ nsClipboard::~nsClipboard() // free the selection data, if any if (mSelectionData.data != nsnull) - nsAllocator::Free(mSelectionData.data); + nsMemory::Free(mSelectionData.data); gtk_object_remove_data(GTK_OBJECT(sWidget), "cb"); @@ -475,7 +475,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, } // transferable is now owning the data, so we can free it. - nsAllocator::Free(mSelectionData.data); + nsMemory::Free(mSelectionData.data); mSelectionData.data = nsnull; mSelectionData.length = 0; @@ -620,7 +620,7 @@ nsClipboard::SelectionReceiver (GtkWidget *aWidget, // the conversion. decoder->GetMaxLength(data, numberOfBytes, &outUnicodeLen); // |outUnicodeLen| is number of chars if (outUnicodeLen) { - unicodeData = NS_REINTERPRET_CAST(PRUnichar*, nsAllocator::Alloc((outUnicodeLen + 1) * sizeof(PRUnichar))); + unicodeData = NS_REINTERPRET_CAST(PRUnichar*, nsMemory::Alloc((outUnicodeLen + 1) * sizeof(PRUnichar))); if ( unicodeData ) { PRInt32 numberTmp = numberOfBytes; rv = decoder->Convert(data, &numberTmp, unicodeData, &outUnicodeLen); @@ -780,7 +780,7 @@ nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList, g_print(" returning %i\n }\n", *outResult); #endif - nsAllocator::Free(mSelectionData.data); + nsMemory::Free(mSelectionData.data); mSelectionData.data = nsnull; mSelectionData.length = 0; @@ -874,7 +874,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText (castedUnicode, dataLength / 2, &plainTextData, &plainTextLen); if (clipboardData) { - nsAllocator::Free(NS_REINTERPRET_CAST(char*, clipboardData)); + nsMemory::Free(NS_REINTERPRET_CAST(char*, clipboardData)); clipboardData = plainTextData; dataLength = plainTextLen; } @@ -883,7 +883,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, PRUnichar* castedUnicode = NS_REINTERPRET_CAST(PRUnichar*, clipboardData); nsString str(castedUnicode, dataLength); char *utf8String = str.ToNewUTF8String(); - nsAllocator::Free(NS_REINTERPRET_CAST(char*, clipboardData)); + nsMemory::Free(NS_REINTERPRET_CAST(char*, clipboardData)); clipboardData = utf8String; dataLength = strlen(utf8String); } @@ -920,7 +920,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, PRUnichar *castedData = NS_REINTERPRET_CAST(PRUnichar*, clipboardData); encoder->GetMaxLength(castedData, dataLength, &platformLen); if ( platformLen ) { - platformText = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(platformLen + sizeof(char))); + platformText = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(platformLen + sizeof(char))); if ( platformText ) { PRInt32 len = (PRInt32)dataLength; rv = encoder->Convert(castedData, &len, platformText, &platformLen); @@ -946,7 +946,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, g_print("\nXmbTextListToTextProperty succeeded\n text is %s\n length is %d\n", prop.value, prop.nitems); #endif - nsAllocator::Free(platformText); + nsMemory::Free(platformText); platformText = (char *)prop.value; platformLen = prop.nitems; } @@ -957,7 +957,7 @@ void nsClipboard::SelectionGetCB(GtkWidget *widget, #endif if (clipboardData) { - nsAllocator::Free(NS_REINTERPRET_CAST(char*, clipboardData)); + nsMemory::Free(NS_REINTERPRET_CAST(char*, clipboardData)); clipboardData = platformText; dataLength = platformLen; } diff --git a/mozilla/widget/src/gtk/nsSound.cpp b/mozilla/widget/src/gtk/nsSound.cpp index 20e3286a337..de60b025ee9 100644 --- a/mozilla/widget/src/gtk/nsSound.cpp +++ b/mozilla/widget/src/gtk/nsSound.cpp @@ -22,7 +22,7 @@ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" diff --git a/mozilla/widget/src/mac/nsClipboard.cpp b/mozilla/widget/src/mac/nsClipboard.cpp index 788b3422b77..3df1fe3e7fb 100644 --- a/mozilla/widget/src/mac/nsClipboard.cpp +++ b/mozilla/widget/src/mac/nsClipboard.cpp @@ -156,11 +156,11 @@ nsClipboard :: SetNativeClipboardData ( PRInt32 aWhichClipboard ) if ( numTextBytes != noErr ) errCode = NS_ERROR_FAILURE; #endif - nsAllocator::Free ( plainTextData ); + nsMemory::Free ( plainTextData ); } } // if unicode - nsAllocator::Free ( data ); + nsMemory::Free ( data ); } } // foreach flavor in transferable @@ -252,7 +252,7 @@ nsClipboard :: GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 &convertedText, &convertedTextLen ); if ( convertedText ) { // out with the old, in with the new - nsAllocator::Free(clipboardData); + nsMemory::Free(clipboardData); clipboardData = convertedText; dataSize = convertedTextLen * 2; dataFound = PR_TRUE; @@ -273,7 +273,7 @@ nsClipboard :: GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 #ifdef NS_DEBUG if ( errCode != NS_OK ) printf("nsClipboard:: Error setting data into transferable\n"); #endif - nsAllocator::Free ( clipboardData ); + nsMemory::Free ( clipboardData ); // we found one, get out of this loop! break; @@ -331,7 +331,7 @@ nsClipboard :: GetDataOffClipboard ( ResType inMacFlavor, void** outData, PRInt3 return NS_ERROR_OUT_OF_MEMORY; long dataSize = ::GetScrap ( dataHand, inMacFlavor, &offsetUnused ); if ( dataSize > 0 ) { - char* dataBuff = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(dataSize)); + char* dataBuff = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(dataSize)); if ( !dataBuff ) return NS_ERROR_OUT_OF_MEMORY; ::HLock(dataHand); @@ -379,7 +379,7 @@ nsClipboard :: HasDataMatchingFlavors ( nsISupportsArray* aFlavorList, PRInt32 a char* mimeMapperData = nsnull; GetDataOffClipboard ( nsMimeMapperMac::MappingFlavor(), (void**)&mimeMapperData, 0 ); nsMimeMapperMac theMapper ( mimeMapperData ); - nsAllocator::Free ( mimeMapperData ); + nsMemory::Free ( mimeMapperData ); PRUint32 length; aFlavorList->Count(&length); diff --git a/mozilla/widget/src/mac/nsDragService.cpp b/mozilla/widget/src/mac/nsDragService.cpp index 5a528864600..dd4bbe732b4 100644 --- a/mozilla/widget/src/mac/nsDragService.cpp +++ b/mozilla/widget/src/mac/nsDragService.cpp @@ -451,7 +451,7 @@ printf("looking for data in type %s, mac flavor %ld\n", NS_STATIC_CAST(const cha &convertedText, &convertedTextLen ); if ( convertedText ) { // out with the old, in with the new - nsAllocator::Free(dataBuff); + nsMemory::Free(dataBuff); dataBuff = convertedText; dataSize = convertedTextLen * 2; dataFound = PR_TRUE; @@ -484,7 +484,7 @@ printf("looking for data in type %s, mac flavor %ld\n", NS_STATIC_CAST(const cha if ( errCode != NS_OK ) printf("nsDragService:: Error setting data into transferable\n"); #endif - nsAllocator::Free ( dataBuff ); + nsMemory::Free ( dataBuff ); errCode = NS_OK; // we found one, get out of this loop! @@ -620,7 +620,7 @@ nsDragService :: DragSendDataProc ( FlavorType inFlavor, void* inRefCon, ItemRef retVal = ::SetDragItemFlavorData ( inDragRef, inItemRef, inFlavor, data, dataSize, 0 ); NS_ASSERTION ( retVal == noErr, "SDIFD failed in DragSendDataProc" ); } - nsAllocator::Free ( data ); + nsMemory::Free ( data ); } // if valid refcon return retVal; @@ -661,7 +661,7 @@ nsDragService :: GetDataForFlavor ( nsISupportsArray* inDragItems, DragReference char* mappings = LookupMimeMappingsForItem(inDragRef, inItemIndex) ; nsMimeMapperMac theMapper ( mappings ); theMapper.MapMacOSTypeToMimeType ( inFlavor, mimeFlavor ); - nsAllocator::Free ( mappings ); + nsMemory::Free ( mappings ); // if someone was asking for text/plain, lookup unicode instead so we can convert it. PRBool needToDoConversionToPlainText = PR_FALSE; @@ -686,7 +686,7 @@ nsDragService :: GetDataForFlavor ( nsISupportsArray* inDragItems, DragReference PRInt32 plainTextLen = 0; nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText ( castedUnicode, *outDataSize / 2, &plainTextData, &plainTextLen ); if ( *outData ) { - nsAllocator::Free(*outData); + nsMemory::Free(*outData); *outData = plainTextData; *outDataSize = plainTextLen; } @@ -724,7 +724,7 @@ nsDragService :: LookupMimeMappingsForItem ( DragReference inDragRef, ItemRefere #if 0 OSErr err = ::GetFlavorDataSize ( inDragRef, itemRef, nsMimeMapperMac::MappingFlavor(), &mapperSize ); if ( !err && mapperSize > 0 ) { - mapperData = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(mapperSize + 1)); + mapperData = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(mapperSize + 1)); if ( !mapperData ) return nsnull; @@ -762,7 +762,7 @@ nsDragService :: ExtractDataFromOS ( DragReference inDragRef, ItemReference inIt Size buffSize = 0; OSErr err = ::GetFlavorDataSize ( inDragRef, inItemRef, inFlavor, &buffSize ); if ( !err && buffSize > 0 ) { - buff = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(buffSize + 1)); + buff = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(buffSize + 1)); if ( buff ) { err = ::GetFlavorData ( inDragRef, inItemRef, inFlavor, buff, &buffSize, 0 ); if ( err ) { @@ -778,7 +778,7 @@ nsDragService :: ExtractDataFromOS ( DragReference inDragRef, ItemReference inIt if ( NS_FAILED(retval) ) { if ( buff ) - nsAllocator::Free(buff); + nsMemory::Free(buff); } else { *outBuffer = buff; diff --git a/mozilla/widget/src/mac/nsMimeMapper.cpp b/mozilla/widget/src/mac/nsMimeMapper.cpp index c500e14bb9c..f73f85aa60c 100644 --- a/mozilla/widget/src/mac/nsMimeMapper.cpp +++ b/mozilla/widget/src/mac/nsMimeMapper.cpp @@ -225,7 +225,7 @@ nsMimeMapperMac :: ExportMapping ( short * outLength ) const // create a string of that length and fill it in with each mapping. We have to // consider the possibility that there aren't any generic (internal mozilla) flavors // so the map could be empty. - exportBuffer = NS_STATIC_CAST(char*, nsAllocator::Alloc(len + 1)); // don't forget the NULL + exportBuffer = NS_STATIC_CAST(char*, nsMemory::Alloc(len + 1)); // don't forget the NULL if ( !exportBuffer ) return nsnull; *exportBuffer = '\0'; // null terminate at the start for strcat() diff --git a/mozilla/widget/src/mac/nsSound.cpp b/mozilla/widget/src/mac/nsSound.cpp index 34b97dd59d3..f253a6002a8 100644 --- a/mozilla/widget/src/mac/nsSound.cpp +++ b/mozilla/widget/src/mac/nsSound.cpp @@ -22,7 +22,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "nsSound.h" diff --git a/mozilla/widget/src/photon/nsSound.cpp b/mozilla/widget/src/photon/nsSound.cpp index 1b075f8a085..003f75c7996 100644 --- a/mozilla/widget/src/photon/nsSound.cpp +++ b/mozilla/widget/src/photon/nsSound.cpp @@ -23,7 +23,7 @@ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include "stdio.h" diff --git a/mozilla/widget/src/windows/nsClipboard.cpp b/mozilla/widget/src/windows/nsClipboard.cpp index 1c79a6fa262..2dc9495c9c7 100644 --- a/mozilla/widget/src/windows/nsClipboard.cpp +++ b/mozilla/widget/src/windows/nsClipboard.cpp @@ -237,7 +237,7 @@ nsresult nsClipboard::GetGlobalData(HGLOBAL aHGBL, void ** aData, PRUint32 * aLe if (aHGBL != NULL) { LPSTR lpStr = (LPSTR)::GlobalLock(aHGBL); DWORD allocSize = ::GlobalSize(aHGBL); - char* data = NS_STATIC_CAST(char*, nsAllocator::Alloc(allocSize)); + char* data = NS_STATIC_CAST(char*, nsMemory::Alloc(allocSize)); if ( data ) { nsCRT::memcpy ( data, lpStr, allocSize ); @@ -514,7 +514,7 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT NS_ASSERTION ( aIndex < numFiles, "Asked for a file index out of range of list" ); if (numFiles > 0) { UINT fileNameLen = ::DragQueryFile(dropFiles, aIndex, nsnull, 0); - char* buffer = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(fileNameLen + 1)); + char* buffer = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(fileNameLen + 1)); if ( buffer ) { ::DragQueryFile(dropFiles, aIndex, buffer, fileNameLen + 1); *aData = buffer; @@ -609,7 +609,7 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject, &convertedText, &convertedTextLen ); if ( convertedText ) { // out with the old, in with the new - nsAllocator::Free(data); + nsMemory::Free(data); data = convertedText; dataLen = convertedTextLen * 2; dataFound = PR_TRUE; @@ -640,7 +640,7 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject, NS_ASSERTION ( genericDataWrapper, "About to put null data into the transferable" ); aTransferable->SetTransferData(flavorStr, genericDataWrapper, dataLen); - nsAllocator::Free ( NS_REINTERPRET_CAST(char*, data) ); + nsMemory::Free ( NS_REINTERPRET_CAST(char*, data) ); res = NS_OK; // we found one, get out of the loop diff --git a/mozilla/widget/src/windows/nsDataObj.cpp b/mozilla/widget/src/windows/nsDataObj.cpp index b67947e9fd0..9eef7388d53 100644 --- a/mozilla/widget/src/windows/nsDataObj.cpp +++ b/mozilla/widget/src/windows/nsDataObj.cpp @@ -550,7 +550,7 @@ HRESULT nsDataObj::GetText(nsCAutoString * aDataFlavor, FORMATETC& aFE, STGMEDIU // replace the unicode data with our plaintext data. Recall that |plainTextLen| doesn't include // the null in the length. - nsAllocator::Free(data); + nsMemory::Free(data); if ( plainTextData ) { data = plainTextData; allocLen = plainTextLen + sizeof(char); @@ -575,7 +575,7 @@ HRESULT nsDataObj::GetText(nsCAutoString * aDataFlavor, FORMATETC& aFE, STGMEDIU aSTG.hGlobal = hGlobalMemory; // Now, delete the memory that was created by CreateDataFromPrimitive (or our text/plain data) - nsAllocator::Free(data); + nsMemory::Free(data); return ResultFromScode(S_OK); } diff --git a/mozilla/widget/src/windows/nsSound.cpp b/mozilla/widget/src/windows/nsSound.cpp index 04e81aa657b..12e1ccd31a6 100644 --- a/mozilla/widget/src/windows/nsSound.cpp +++ b/mozilla/widget/src/windows/nsSound.cpp @@ -22,7 +22,7 @@ */ #include "nscore.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "plstr.h" #include diff --git a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index 2949a5177b0..1cba764f1f8 100644 --- a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -162,7 +162,7 @@ nsPrimitiveHelpers :: ConvertUnicodeToPlatformPlainText ( PRUnichar* inUnicode, // the conversion. encoder->GetMaxLength(inUnicode, inUnicodeLen, outPlainTextLen); if ( *outPlainTextLen ) { - *outPlainTextData = NS_REINTERPRET_CAST(char*, nsAllocator::Alloc(*outPlainTextLen + sizeof(char))); + *outPlainTextData = NS_REINTERPRET_CAST(char*, nsMemory::Alloc(*outPlainTextLen + sizeof(char))); if ( *outPlainTextData ) { rv = encoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nsnull, '?'); rv = encoder->Convert(inUnicode, &inUnicodeLen, *outPlainTextData, outPlainTextLen); @@ -215,7 +215,7 @@ nsPrimitiveHelpers :: ConvertPlatformPlainTextToUnicode ( const char* inText, PR // the conversion. decoder->GetMaxLength(inText, inTextLen, outUnicodeLen); // |outUnicodeLen| is number of chars if ( *outUnicodeLen ) { - *outUnicode = NS_REINTERPRET_CAST(PRUnichar*, nsAllocator::Alloc((*outUnicodeLen + 1) * sizeof(PRUnichar))); + *outUnicode = NS_REINTERPRET_CAST(PRUnichar*, nsMemory::Alloc((*outUnicodeLen + 1) * sizeof(PRUnichar))); if ( *outUnicode ) { rv = decoder->Convert(inText, &inTextLen, *outUnicode, outUnicodeLen); (*outUnicode)[*outUnicodeLen] = '\0'; // null terminate. Convert() doesn't do it for us @@ -240,7 +240,7 @@ nsPrimitiveHelpers :: ConvertPlatformPlainTextToUnicode ( const char* inText, PR // be reallocated regardless (disposing the old buffer is taken care of internally, see // the note below). // -// NOTE: this assumes that it can use nsAllocator to dispose of the old buffer. +// NOTE: this assumes that it can use nsMemory to dispose of the old buffer. // nsresult nsLinebreakHelpers :: ConvertPlatformToDOMLinebreaks ( const char* inFlavor, void** ioData, @@ -260,7 +260,7 @@ nsLinebreakHelpers :: ConvertPlatformToDOMLinebreaks ( const char* inFlavor, voi *ioLengthInBytes, ioLengthInBytes ); if ( NS_SUCCEEDED(retVal) ) { if ( buffAsChars != oldBuffer ) // check if buffer was reallocated - nsAllocator::Free ( oldBuffer ); + nsMemory::Free ( oldBuffer ); *ioData = buffAsChars; } } @@ -276,7 +276,7 @@ nsLinebreakHelpers :: ConvertPlatformToDOMLinebreaks ( const char* inFlavor, voi *ioLengthInBytes / sizeof(PRUnichar), &newLengthInChars ); if ( NS_SUCCEEDED(retVal) ) { if ( buffAsUnichar != oldBuffer ) // check if buffer was reallocated - nsAllocator::Free ( oldBuffer ); + nsMemory::Free ( oldBuffer ); *ioData = buffAsUnichar; *ioLengthInBytes = newLengthInChars * sizeof(PRUnichar); } diff --git a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.h b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.h index 136ff531277..e30c6270349 100644 --- a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.h +++ b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.h @@ -73,7 +73,7 @@ public: // be reallocated regardless (disposing the old buffer is taken care of internally, see // the note below). // - // NOTE: this assumes that it can use nsAllocator to dispose of the old buffer. + // NOTE: this assumes that it can use nsMemory to dispose of the old buffer. static nsresult ConvertPlatformToDOMLinebreaks ( const char* inFlavor, void** ioData, PRInt32* ioLengthInBytes ) ; }; // class nsLinebreakHelpers diff --git a/mozilla/widget/src/xpwidgets/nsTransferable.cpp b/mozilla/widget/src/xpwidgets/nsTransferable.cpp index 9f870ea61fd..7ba019c0fb5 100644 --- a/mozilla/widget/src/xpwidgets/nsTransferable.cpp +++ b/mozilla/widget/src/xpwidgets/nsTransferable.cpp @@ -39,7 +39,7 @@ Notes to self: #include "nsIComponentManager.h" #include "nsCOMPtr.h" #include "nsISupportsPrimitives.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsPrimitiveHelpers.h" #include "nsIFileSpec.h" @@ -198,7 +198,7 @@ DataStruct::WriteCache(nsISupports* aData, PRUint32 aDataLen) if ( buff ) { PRUint32 ignored; outStr->Write(NS_REINTERPRET_CAST(char*, buff), aDataLen, &ignored); - nsAllocator::Free(buff); + nsMemory::Free(buff); return NS_OK; } } @@ -222,7 +222,7 @@ DataStruct::ReadCache(nsISupports** aData, PRUint32* aDataLen) cacheFile->GetFileSize(&fileSize); // create new memory for the large clipboard data - char * data = (char *)nsAllocator::Alloc(fileSize); + char * data = (char *)nsMemory::Alloc(fileSize); if ( !data ) return NS_ERROR_OUT_OF_MEMORY; @@ -240,7 +240,7 @@ DataStruct::ReadCache(nsISupports** aData, PRUint32* aDataLen) // delete the buffer because we got an error // and zero the return params - nsAllocator::Free(data); + nsMemory::Free(data); *aData = nsnull; *aDataLen = 0; } diff --git a/mozilla/xpcom/appshell/eventloop/windows/nsIWinEvent.idl b/mozilla/xpcom/appshell/eventloop/windows/nsIWinEvent.idl index acee50fa0de..f8c9190d7f6 100644 --- a/mozilla/xpcom/appshell/eventloop/windows/nsIWinEvent.idl +++ b/mozilla/xpcom/appshell/eventloop/windows/nsIWinEvent.idl @@ -1,3 +1,25 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + #include "nsISupports.idl" #include "nsIEvent.idl" @@ -8,7 +30,7 @@ [scriptable, uuid(2EFB5005-4508-11d3-AEDA-00A024FFC08C)] interface nsIWinEvent : nsIEvent { - [noscript] attribute voidStar hwnd; + [noscript] attribute voidPtr hwnd; attribute unsigned long message; attribute unsigned long wParam; attribute unsigned long lParam; diff --git a/mozilla/xpcom/appshell/eventloop/windows/nsIWinEventFilter.idl b/mozilla/xpcom/appshell/eventloop/windows/nsIWinEventFilter.idl index 4fbdf0a018f..a131e719c05 100644 --- a/mozilla/xpcom/appshell/eventloop/windows/nsIWinEventFilter.idl +++ b/mozilla/xpcom/appshell/eventloop/windows/nsIWinEventFilter.idl @@ -1,3 +1,25 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + #include "nsISupports.idl" #include "nsIEventFilter.idl" @@ -9,7 +31,7 @@ [scriptable, uuid(2EFB5006-4508-11d3-AEDA-00A024FFC08C)] interface nsIWinEventFilter : nsIEventFilter { - [noscript] attribute voidStar hwnd; + [noscript] attribute voidPtr hwnd; attribute unsigned long MsgFilterMin; attribute unsigned long MsgFilterMax; attribute unsigned long RemoveFlags; diff --git a/mozilla/xpcom/appshell/eventloop/xp/nsIEvent.idl b/mozilla/xpcom/appshell/eventloop/xp/nsIEvent.idl index 0bf6a874a44..83e7934a7ee 100644 --- a/mozilla/xpcom/appshell/eventloop/xp/nsIEvent.idl +++ b/mozilla/xpcom/appshell/eventloop/xp/nsIEvent.idl @@ -60,7 +60,7 @@ interface nsIEvent : nsISupports return the pointer in. */ [noscript] void GetNativeData(in nsNativeEventDataType dataType, - out voidStar data); + out voidPtr data); /* Sets the internal structure to hold the appropriate data. @@ -77,7 +77,7 @@ interface nsIEvent : nsISupports NS_INVALID_ARG The data type sent is not supported by this event. */ [noscript] void SetNativeData(in nsNativeEventDataType dataType, - in voidStar data); + in voidPtr data); readonly attribute boolean isExitEvent; }; diff --git a/mozilla/xpcom/appshell/eventloop/xp/nsIEventFilter.idl b/mozilla/xpcom/appshell/eventloop/xp/nsIEventFilter.idl index 01662ca8587..f6238f2e6cd 100644 --- a/mozilla/xpcom/appshell/eventloop/xp/nsIEventFilter.idl +++ b/mozilla/xpcom/appshell/eventloop/xp/nsIEventFilter.idl @@ -60,7 +60,7 @@ interface nsIEventFilter : nsISupports return the pointer in. */ [noscript] void GetNativeData(in nsNativeFilterDataType dataType, - out voidStar data); + out voidPtr data); /* Sets the internal structure to hold the appropriate data. @@ -77,7 +77,7 @@ interface nsIEventFilter : nsISupports NS_INVALID_ARG The data type sent is not supported by this event. */ [noscript] void SetNativeData(in nsNativeFilterDataType dataType, - in voidStar data); + in voidPtr data); }; diff --git a/mozilla/xpcom/base/nsAllocator.cpp b/mozilla/xpcom/base/nsAllocator.cpp index 07906466a66..cf04b4ec2b7 100644 --- a/mozilla/xpcom/base/nsAllocator.cpp +++ b/mozilla/xpcom/base/nsAllocator.cpp @@ -22,178 +22,5 @@ */ //////////////////////////////////////////////////////////////////////////////// -// Implementation of nsIAllocator using NSPR +// obsolete //////////////////////////////////////////////////////////////////////////////// - -#include "nsAllocator.h" -#include /* for memcpy */ - -nsAllocatorImpl::nsAllocatorImpl(nsISupports* outer) -{ - NS_INIT_AGGREGATED(outer); -} - -nsAllocatorImpl::~nsAllocatorImpl(void) -{ -} - -NS_IMPL_AGGREGATED(nsAllocatorImpl); - -NS_METHOD -nsAllocatorImpl::AggregatedQueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_ENSURE_ARG_POINTER(aInstancePtr); - - if (aIID.Equals(NS_GET_IID(nsISupports))) - *aInstancePtr = GetInner(); - else if (aIID.Equals(NS_GET_IID(nsIAllocator))) - *aInstancePtr = NS_STATIC_CAST(nsIAllocator*, this); - else { - *aInstancePtr = nsnull; - return NS_NOINTERFACE; - } - - NS_ADDREF((nsISupports*)*aInstancePtr); - return NS_OK; -} - -NS_METHOD -nsAllocatorImpl::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr) -{ - NS_ENSURE_ARG_POINTER(aInstancePtr); - NS_ENSURE_PROPER_AGGREGATION(outer, aIID); - - nsAllocatorImpl* mm = new nsAllocatorImpl(outer); - if (mm == NULL) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = mm->AggregatedQueryInterface(aIID, aInstancePtr); - - if (NS_FAILED(rv)) - delete mm; - return rv; -} - -//////////////////////////////////////////////////////////////////////////////// - -NS_METHOD_(void*) -nsAllocatorImpl::Alloc(PRUint32 size) -{ - return PR_Malloc(size); -} - -NS_METHOD_(void*) -nsAllocatorImpl::Realloc(void* ptr, PRUint32 size) -{ - return PR_Realloc(ptr, size); -} - -NS_METHOD -nsAllocatorImpl::Free(void* ptr) -{ - PR_Free(ptr); - return NS_OK; -} - -NS_METHOD -nsAllocatorImpl::HeapMinimize(void) -{ -#ifdef XP_MAC - // This used to live in the memory allocators no Mac, but does no more - // Needs to be hooked up in the new world. -// CallCacheFlushers(0x7fffffff); -#endif - return NS_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -#if 0 -nsAllocatorFactory::nsAllocatorFactory(void) -{ - NS_INIT_REFCNT(); -} - -nsAllocatorFactory::~nsAllocatorFactory(void) -{ -} - -NS_IMPL_ISUPPORTS1(nsAllocatorFactory, nsIFactory) - -NS_METHOD -nsAllocatorFactory::CreateInstance(nsISupports *aOuter, - REFNSIID aIID, - void **aResult) -{ - return nsAllocatorImpl::Create(aOuter, aIID, aResult); -} - -NS_METHOD -nsAllocatorFactory::LockFactory(PRBool aLock) -{ - return NS_OK; // XXX what? -} -#endif - -//////////////////////////////////////////////////////////////////////////////// - -/* -* Public shortcuts to the shared allocator's methods -* (all these methods are class statics) -*/ - -// public: -void* nsAllocator::Alloc(PRUint32 size) -{ - if(!EnsureAllocator()) return NULL; - return mAllocator->Alloc(size); -} - -void* nsAllocator::Realloc(void* ptr, PRUint32 size) -{ - if(!EnsureAllocator()) return NULL; - return mAllocator->Realloc(ptr, size); -} - -void nsAllocator::Free(void* ptr) -{ - if(!EnsureAllocator()) return; - mAllocator->Free(ptr); -} - -void nsAllocator::HeapMinimize() -{ - if(!EnsureAllocator()) return; - mAllocator->HeapMinimize(); -} - -void* nsAllocator::Clone(const void* ptr, PRUint32 size) -{ - if(!ptr || !EnsureAllocator()) return NULL; - void* p = mAllocator->Alloc(size); - if(p) memcpy(p, ptr, size); - return p; -} - -NS_EXPORT nsIAllocator* -nsAllocator::GetGlobalAllocator() -{ - if(!EnsureAllocator()) return nsnull; - NS_ADDREF(mAllocator); - return mAllocator; -} - -// private: - -nsIAllocator* nsAllocator::mAllocator = NULL; - -PRBool nsAllocator::FetchAllocator() -{ - nsAllocatorImpl::Create(NULL, NS_GET_IID(nsIAllocator), (void**)&mAllocator); - NS_ASSERTION(mAllocator, "failed to get Allocator!"); - return (mAllocator ? PR_TRUE : PR_FALSE); -} - -void nsAllocator::Shutdown() -{ - NS_IF_RELEASE(mAllocator); -} diff --git a/mozilla/xpcom/base/nsAllocator.h b/mozilla/xpcom/base/nsAllocator.h index 0d239a31ad9..40254476a7f 100644 --- a/mozilla/xpcom/base/nsAllocator.h +++ b/mozilla/xpcom/base/nsAllocator.h @@ -21,7 +21,7 @@ */ //////////////////////////////////////////////////////////////////////////////// -// Implementation of nsIAllocator using NSPR +// obsolete //////////////////////////////////////////////////////////////////////////////// #ifndef nsAllocator_h__ @@ -32,65 +32,4 @@ #include "nsAgg.h" #include "nsIFactory.h" -class nsAllocatorImpl : public nsIAllocator { -public: - static const nsCID& CID() { static nsCID cid = NS_ALLOCATOR_CID; return cid; } - - /** - * Allocates a block of memory of a particular size. - * - * @param size - the size of the block to allocate - * @result the block of memory - */ - NS_IMETHOD_(void*) Alloc(PRUint32 size); - - /** - * Reallocates a block of memory to a new size. - * - * @param ptr - the block of memory to reallocate - * @param size - the new size - * @result the rellocated block of memory - */ - NS_IMETHOD_(void*) Realloc(void* ptr, PRUint32 size); - - /** - * Frees a block of memory. - * - * @param ptr - the block of memory to free - */ - NS_IMETHOD Free(void* ptr); - - /** - * Attempts to shrink the heap. - */ - NS_IMETHOD HeapMinimize(void); - - //////////////////////////////////////////////////////////////////////////// - - nsAllocatorImpl(nsISupports* outer); - virtual ~nsAllocatorImpl(void); - - NS_DECL_AGGREGATED - - static NS_METHOD - Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr); -}; - -//////////////////////////////////////////////////////////////////////////////// -#if 0 -class nsAllocatorFactory : public nsIFactory { -public: - NS_IMETHOD CreateInstance(nsISupports *aOuter, - REFNSIID aIID, - void **aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - - nsAllocatorFactory(void); - virtual ~nsAllocatorFactory(void); - - NS_DECL_ISUPPORTS -}; -#endif -//////////////////////////////////////////////////////////////////////////////// #endif // nsAllocator_h__ diff --git a/mozilla/xpcom/base/nsConsoleService.cpp b/mozilla/xpcom/base/nsConsoleService.cpp index c13e6908013..8ec310649f9 100644 --- a/mozilla/xpcom/base/nsConsoleService.cpp +++ b/mozilla/xpcom/base/nsConsoleService.cpp @@ -26,7 +26,7 @@ /* Threadsafe. */ -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIServiceManager.h" #include "nsProxyObjectManager.h" @@ -50,7 +50,7 @@ nsConsoleService::nsConsoleService() rv = nsSupportsArray::Create(NULL, NS_GET_IID(nsISupportsArray), (void**)&mListeners); mMessages = (nsIConsoleMessage **) - nsAllocator::Alloc(mBufferSize * sizeof(nsIConsoleMessage *)); + nsMemory::Alloc(mBufferSize * sizeof(nsIConsoleMessage *)); mLock = PR_NewLock(); @@ -83,7 +83,7 @@ nsConsoleService::~nsConsoleService() } #endif - nsAllocator::Free(mMessages); + nsMemory::Free(mMessages); if (mLock) PR_DestroyLock(mLock); } @@ -190,7 +190,7 @@ nsConsoleService::GetMessageArray(nsIConsoleMessage ***messages, PRUint32 *count * array object when called from script. */ messageArray = (nsIConsoleMessage **) - nsAllocator::Alloc(sizeof (nsIConsoleMessage *)); + nsMemory::Alloc(sizeof (nsIConsoleMessage *)); *messageArray = nsnull; *messages = messageArray; *count = 0; @@ -200,8 +200,8 @@ nsConsoleService::GetMessageArray(nsIConsoleMessage ***messages, PRUint32 *count PRUint32 resultSize = mFull ? mBufferSize : mCurrent; messageArray = - (nsIConsoleMessage **)nsAllocator::Alloc((sizeof (nsIConsoleMessage *)) - * resultSize); + (nsIConsoleMessage **)nsMemory::Alloc((sizeof (nsIConsoleMessage *)) + * resultSize); if (messageArray == nsnull) { *messages = nsnull; diff --git a/mozilla/xpcom/base/nsIAllocator.h b/mozilla/xpcom/base/nsIAllocator.h index df72dafb12d..387e7913f95 100644 --- a/mozilla/xpcom/base/nsIAllocator.h +++ b/mozilla/xpcom/base/nsIAllocator.h @@ -20,95 +20,22 @@ * Contributor(s): */ +/** + * XXX This file is obsolete. Use nsIMemory.idl or nsMemory.h instead. + */ + #ifndef nsIAllocator_h___ #define nsIAllocator_h___ -#include "nsISupports.h" +#include "nsMemory.h" -/** - * Unlike IMalloc, this interface returns nsresults and doesn't - * implement the problematic GetSize and DidAlloc routines. - */ +#define nsIAllocator nsIMemory +#define nsAllocator nsMemory +#define GetGlobalAllocator GetGlobalMemoryService -#define NS_IALLOCATOR_IID \ -{ /* 56def700-b1b9-11d2-8177-006008119d7a */ \ - 0x56def700, \ - 0xb1b9, \ - 0x11d2, \ - {0x81, 0x77, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \ -} -#define NS_ALLOCATOR_PROGID "component://netscape/allocator" -#define NS_ALLOCATOR_CLASSNAME "Allocator" - -class nsIAllocator : public nsISupports { -public: - static const nsIID& GetIID() { static nsIID iid = NS_IALLOCATOR_IID; return iid; } - - /** - * Allocates a block of memory of a particular size. - * - * @param size - the size of the block to allocate - * @result the block of memory - */ - NS_IMETHOD_(void*) Alloc(PRUint32 size) = 0; - - /** - * Reallocates a block of memory to a new size. - * - * @param ptr - the block of memory to reallocate - * @param size - the new size - * @result the rellocated block of memory - */ - NS_IMETHOD_(void*) Realloc(void* ptr, PRUint32 size) = 0; - - /** - * Frees a block of memory. - * - * @param ptr - the block of memory to free - * @param size - the size of the block to be freed. If -1 (the default), - * the implementation must be able to determine the block size by - * examining the block pointer. - */ - NS_IMETHOD Free(void* ptr) = 0; - - /** - * Attempts to shrink the heap. - */ - NS_IMETHOD HeapMinimize(void) = 0; - -}; - -// To get the global memory manager service: -#define NS_ALLOCATOR_CID \ -{ /* aafe6770-b1bb-11d2-8177-006008119d7a */ \ - 0xaafe6770, \ - 0xb1bb, \ - 0x11d2, \ - {0x81, 0x77, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \ -} - -/* -* Public shortcuts to the shared allocator's methods -*/ - -class nsAllocator -{ -public: - static NS_EXPORT void* Alloc(PRUint32 size); - static NS_EXPORT void* Realloc(void* ptr, PRUint32 size); - static NS_EXPORT void Free(void* ptr); - static NS_EXPORT void HeapMinimize(); - static NS_EXPORT void* Clone(const void* ptr, PRUint32 size); - static NS_EXPORT nsIAllocator* GetGlobalAllocator(); - static NS_EXPORT void Shutdown(); -private: - nsAllocator(); // not implemented - static PRBool EnsureAllocator() {return mAllocator || FetchAllocator();} - static PRBool FetchAllocator(); - static nsIAllocator* mAllocator; -}; - - -//////////////////////////////////////////////////////////////////////////////// +#define NS_IALLOCATOR_IID NS_GET_IID(nsIMemory) +#define NS_ALLOCATOR_PROGID NS_MEMORY_PROGID +#define NS_ALLOCATOR_CLASSNAME NS_MEMORY_CLASSNAME +#define NS_ALLOCATOR_CID NS_MEMORY_CID #endif /* nsIAllocator_h___ */ diff --git a/mozilla/xpcom/base/nsSystemInfo.cpp b/mozilla/xpcom/base/nsSystemInfo.cpp index 0757eba9f51..f7503263dbf 100644 --- a/mozilla/xpcom/base/nsSystemInfo.cpp +++ b/mozilla/xpcom/base/nsSystemInfo.cpp @@ -23,7 +23,7 @@ #include "prsystem.h" #include "nsSystemInfo.h" -#include "nsAllocator.h" +#include "nsMemory.h" nsSystemInfo::nsSystemInfo() { @@ -41,11 +41,11 @@ NS_IMETHODIMP \ nsSystemInfo::Get##name(char **_retval) \ { \ NS_ENSURE_ARG_POINTER(_retval); \ - char *buf = (char *)nsAllocator::Alloc(256); \ + char *buf = (char *)nsMemory::Alloc(256); \ if (!buf) \ return NS_ERROR_OUT_OF_MEMORY; \ if (PR_GetSystemInfo((cmd), buf, 256) == PR_FAILURE) { \ - nsAllocator::Free(buf); \ + nsMemory::Free(buf); \ return NS_ERROR_FAILURE; \ } \ *_retval = buf; \ diff --git a/mozilla/xpcom/base/nsrootidl.idl b/mozilla/xpcom/base/nsrootidl.idl index cacb8157906..bc4b3987afa 100644 --- a/mozilla/xpcom/base/nsrootidl.idl +++ b/mozilla/xpcom/base/nsrootidl.idl @@ -53,8 +53,6 @@ typedef unsigned long size_t; [ptr] native voidPtr(void); [ptr] native charPtr(char); -[ptr] native voidStar(void); -[ptr] native charStar(char); [ref, nsid] native nsIDRef(nsID); [ref, nsid] native nsIIDRef(nsIID); diff --git a/mozilla/xpcom/build/nsXPComInit.cpp b/mozilla/xpcom/build/nsXPComInit.cpp index 8e5a244402b..fd41cefadcc 100644 --- a/mozilla/xpcom/build/nsXPComInit.cpp +++ b/mozilla/xpcom/build/nsXPComInit.cpp @@ -30,7 +30,7 @@ #include "nsPersistentProperties.h" #include "nsScriptableInputStream.h" -#include "nsAllocator.h" +#include "nsMemoryImpl.h" #include "nsArena.h" #include "nsByteBuffer.h" #ifdef PAGE_MANAGER @@ -77,7 +77,7 @@ #endif /* XPCOM_STANDALONE */ // base -static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); +static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); static NS_DEFINE_CID(kConsoleServiceCID, NS_CONSOLESERVICE_CID); // ds static NS_DEFINE_CID(kArenaCID, NS_ARENA_CID); @@ -244,7 +244,7 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result, char* path; binDirectory->GetPath(&path); nsFileSpec spec(path); - nsAllocator::Free(path); + nsMemory::Free(path); nsSpecialSystemDirectory::Set(nsSpecialSystemDirectory::Moz_BinDirectory, &spec); @@ -260,6 +260,10 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result, nsComponentManagerImpl::gComponentManager = compMgr; } + + nsCOMPtr memory = getter_AddRefs(nsMemory::GetGlobalMemoryService()); + rv = servMgr->RegisterService(kMemoryCID, memory); + if (NS_FAILED(rv)) return rv; rv = servMgr->RegisterService(kComponentManagerCID, NS_STATIC_CAST(nsIComponentManager*, compMgr)); if (NS_FAILED(rv)) return rv; @@ -303,10 +307,10 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result, if (NS_FAILED(rv)) return rv; #endif - rv = RegisterGenericFactory(compMgr, kAllocatorCID, - NS_ALLOCATOR_CLASSNAME, - NS_ALLOCATOR_PROGID, - nsAllocatorImpl::Create); + rv = RegisterGenericFactory(compMgr, kMemoryCID, + NS_MEMORY_CLASSNAME, + NS_MEMORY_PROGID, + nsMemoryImpl::Create); if (NS_FAILED(rv)) return rv; rv = RegisterGenericFactory(compMgr, kArenaCID, @@ -639,7 +643,7 @@ nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr) #endif NS_PurgeAtomTable(); - nsAllocator::Shutdown(); + nsMemoryImpl::Shutdown(); nsThread::Shutdown(); #ifdef DEBUG diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index 5cf4c2cf319..d57e0a39589 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -506,7 +506,7 @@ nsComponentManagerImpl::PlatformInit(void) mComponentsOffset = strlen(componentDescriptor); if (componentDescriptor) - nsAllocator::Free(componentDescriptor); + nsMemory::Free(componentDescriptor); @@ -730,7 +730,7 @@ nsComponentManagerImpl::PlatformUnregister(const char *cidString, } if (eLibrary != aLibrary) - nsAllocator::Free(eLibrary); + nsMemory::Free(eLibrary); return rv; } @@ -1293,7 +1293,7 @@ MakeRegistryName(const char *aDllName, const char *prefix, char **regName) PRUint32 len = nsCRT::strlen(prefix); PRUint32 registryNameLen = nsCRT::strlen(aDllName) + len; - registryName = (char *)nsAllocator::Alloc(registryNameLen + 1); + registryName = (char *)nsMemory::Alloc(registryNameLen + 1); // from here on it, we want len sans terminating NUL @@ -1354,7 +1354,7 @@ nsComponentManagerImpl::RegistryLocationForSpec(nsIFile *aSpec, } if (persistentDescriptor) - nsAllocator::Free(persistentDescriptor); + nsMemory::Free(persistentDescriptor); return rv; @@ -1772,7 +1772,7 @@ nsComponentManagerImpl::AddComponentToRegistry(const nsCID &aClass, // XXX if failed, undo registry adds or set invalid bit? How? nsCRT::free(cidString); if (eRegistryName != aRegistryName) - nsAllocator::Free(eRegistryName); + nsMemory::Free(eRegistryName); return rv; } diff --git a/mozilla/xpcom/components/nsIComponentManager.idl b/mozilla/xpcom/components/nsIComponentManager.idl index 1777d82e2cc..1bced57d330 100644 --- a/mozilla/xpcom/components/nsIComponentManager.idl +++ b/mozilla/xpcom/components/nsIComponentManager.idl @@ -46,7 +46,7 @@ interface nsIComponentManager : nsISupports * to implement. nsISupports and nsIFactory are known to * be implemented by the class object. */ - [noscript] voidStar getClassObject(in nsCIDRef aClass, in nsIIDRef aIID); + [noscript] voidPtr getClassObject(in nsCIDRef aClass, in nsIIDRef aIID); /** * progIDToClassID @@ -81,9 +81,9 @@ interface nsIComponentManager : nsISupports * @param aDelegate : Used for aggregation * @param aIID : IID of interface requested */ - [noscript] voidStar createInstance(in nsCIDRef aClass, - in nsISupports aDelegate, - in nsIIDRef aIID); + [noscript] voidPtr createInstance(in nsCIDRef aClass, + in nsISupports aDelegate, + in nsIIDRef aIID); /** * createInstanceByProgID @@ -96,9 +96,9 @@ interface nsIComponentManager : nsISupports * @param aDelegate : Used for aggregation * @param aIID : IID of interface requested */ - [noscript] voidStar createInstanceByProgID(in string aProgID, - in nsISupports aDelegate, - in nsIIDRef IID); + [noscript] voidPtr createInstanceByProgID(in string aProgID, + in nsISupports aDelegate, + in nsIIDRef IID); /** * registryLocationForSpec * diff --git a/mozilla/xpcom/components/nsNativeComponentLoader.cpp b/mozilla/xpcom/components/nsNativeComponentLoader.cpp index cb52cee1587..6470e253d59 100644 --- a/mozilla/xpcom/components/nsNativeComponentLoader.cpp +++ b/mozilla/xpcom/components/nsNativeComponentLoader.cpp @@ -231,7 +231,7 @@ nsNativeComponentLoader::Init(nsIComponentManager *aCompMgr, nsISupports *aReg) } if (uLibrary != eLibrary && uLibrary != nsnull) - nsAllocator::Free(uLibrary); + nsMemory::Free(uLibrary); if (NS_FAILED(rv)) continue; } @@ -772,7 +772,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, break; } } - if (leafName) nsAllocator::Free(leafName); + if (leafName) nsMemory::Free(leafName); #endif if (validExtension == PR_FALSE) @@ -1009,7 +1009,7 @@ nsNativeComponentLoader::GetRegistryDllInfo(const char *aLocation, rv = GetRegistryDllInfo(key, lastModifiedTime, fileSize); if (aLocation != eLocation) - nsAllocator::Free(eLocation); + nsMemory::Free(eLocation); return rv; } @@ -1054,7 +1054,7 @@ nsNativeComponentLoader::SetRegistryDllInfo(const char *aLocation, if (NS_FAILED(rv)) return rv; rv = mRegistry->SetLongLong(key, fileSizeValueName, fileSize); if (aLocation != eLocation) - nsAllocator::Free(eLocation); + nsMemory::Free(eLocation); return rv; } @@ -1074,7 +1074,7 @@ nsNativeComponentLoader::RemoveRegistryDllInfo(const char *aLocation) rv = mRegistry->RemoveSubtree(mXPCOMKey, eLocation); if (aLocation != eLocation) - nsAllocator::Free(eLocation); + nsMemory::Free(eLocation); return rv; } diff --git a/mozilla/xpcom/components/nsRegistry.cpp b/mozilla/xpcom/components/nsRegistry.cpp index d0a19f39314..0354f2e8390 100644 --- a/mozilla/xpcom/components/nsRegistry.cpp +++ b/mozilla/xpcom/components/nsRegistry.cpp @@ -28,7 +28,7 @@ #include "prlock.h" #include "prlog.h" #include "nsCRT.h" -#include "nsAllocator.h" +#include "nsMemory.h" #include "nsCOMPtr.h" #include "nsILocalFile.h" @@ -483,7 +483,7 @@ NS_IMETHODIMP nsRegistry::OpenWellKnownRegistry( nsWellKnownRegistry regid ) { PR_Unlock(mregLock); if (regFile) - nsAllocator::Free(regFile); + nsMemory::Free(regFile); // Store the registry that was opened for optimizing future opens. mCurRegID = regid; @@ -689,7 +689,7 @@ NS_IMETHODIMP nsRegistry::GetStringUTF8( nsRegistryKey baseKey, const char *path // See if that worked. if( rv == NS_OK ) { - *result =(char*)nsAllocator::Alloc( length + 1 ); + *result =(char*)nsMemory::Alloc( length + 1 ); if( *result ) { // Get string from registry into result buffer. @@ -788,7 +788,7 @@ NS_IMETHODIMP nsRegistry::GetBytesUTF8( nsRegistryKey baseKey, const char *path, // See if that worked. if( rv == NS_OK ) { - *result = NS_REINTERPRET_CAST(PRUint8*,nsAllocator::Alloc( *length )); + *result = NS_REINTERPRET_CAST(PRUint8*,nsMemory::Alloc( *length )); if( *result ) { // Get bytes from registry into result field. @@ -1335,7 +1335,7 @@ NS_IMETHODIMP nsRegistry::EscapeKey(PRUint8* key, PRUint32 termination, PRUint32 } // New length includes two extra chars for escapees. *length += escapees * 2; - *escaped = (PRUint8*)nsAllocator::Alloc(*length + termination); + *escaped = (PRUint8*)nsMemory::Alloc(*length + termination); if (*escaped == nsnull) { *length = 0; @@ -1398,7 +1398,7 @@ NS_IMETHODIMP nsRegistry::UnescapeKey(PRUint8* escaped, PRUint32 termination, PR } // New length includes two extra chars for escapees. *length -= escapees * 2; - *key = (PRUint8*)nsAllocator::Alloc(*length + termination); + *key = (PRUint8*)nsMemory::Alloc(*length + termination); if (*key == nsnull) { *length = 0; @@ -1440,7 +1440,7 @@ NS_IMETHODIMP nsRegistry::UnescapeKey(PRUint8* escaped, PRUint32 termination, PR } if (escapees < 0) { - nsAllocator::Free(*key); + nsMemory::Free(*key); *length = 0; *key = nsnull; return NS_ERROR_INVALID_ARG; diff --git a/mozilla/xpcom/components/xcDll.cpp b/mozilla/xpcom/components/xcDll.cpp index 3394d28626f..fe9e54154c2 100644 --- a/mozilla/xpcom/components/xcDll.cpp +++ b/mozilla/xpcom/components/xcDll.cpp @@ -323,7 +323,7 @@ PRBool nsDll::Load(void) char* displayPath; m_dllSpec->GetPath(&displayPath); nsTraceRefcnt::LoadLibrarySymbols(displayPath, m_instance); - nsAllocator::Free(displayPath); + nsMemory::Free(displayPath); } #endif } diff --git a/mozilla/xpcom/ds/nsBufferManager.h b/mozilla/xpcom/ds/nsBufferManager.h index 195dbf68e22..7f42c2c28d9 100644 --- a/mozilla/xpcom/ds/nsBufferManager.h +++ b/mozilla/xpcom/ds/nsBufferManager.h @@ -159,7 +159,7 @@ inline nsresult SVAlloc( nsStringValueImpl& aDest, PRUint32 aCount) { aDest.mBuffer = new CharType[1+aDest.mCapacity]; // PRUint32 theSize=(theNewCapacity<& aDest){ aDest.mRefCount--; if((aDest.mBuffer) && (!aDest.mRefCount)){ - delete [] aDest.mBuffer; // nsAllocator::Free(aDest.mBuffer); + delete [] aDest.mBuffer; // nsMemory::Free(aDest.mBuffer); aDest.mBuffer=0; } diff --git a/mozilla/xpcom/ds/nsCppSharedAllocator.h b/mozilla/xpcom/ds/nsCppSharedAllocator.h index 292ae795ac2..182751f9747 100644 --- a/mozilla/xpcom/ds/nsCppSharedAllocator.h +++ b/mozilla/xpcom/ds/nsCppSharedAllocator.h @@ -1,7 +1,7 @@ #ifndef nsCppSharedAllocator_h__ #define nsCppSharedAllocator_h__ -#include "nsIAllocator.h" // for |nsAllocator| +#include "nsMemory.h" // for |nsMemory| #include "nscore.h" // for |NS_XXX_CAST| #include // to allow placement |new| @@ -69,13 +69,13 @@ class nsCppSharedAllocator pointer allocate( size_type n, const void* /*hint*/=0 ) { - return NS_REINTERPRET_CAST(pointer, nsAllocator::Alloc(NS_STATIC_CAST(PRUint32, n*sizeof(T)))); + return NS_REINTERPRET_CAST(pointer, nsMemory::Alloc(NS_STATIC_CAST(PRUint32, n*sizeof(T)))); } void deallocate( pointer p, size_type /*n*/ ) { - nsAllocator::Free(p); + nsMemory::Free(p); } void diff --git a/mozilla/xpcom/ds/nsISupportsArray.idl b/mozilla/xpcom/ds/nsISupportsArray.idl index 92674254fa3..5d7c533e69e 100644 --- a/mozilla/xpcom/ds/nsISupportsArray.idl +++ b/mozilla/xpcom/ds/nsISupportsArray.idl @@ -81,10 +81,10 @@ interface nsISupportsArray : nsICollection { [notxpcom, noscript] boolean EnumerateForwards(in nsISupportsArrayEnumFunc aFunc, - in voidStar aData); + in voidPtr aData); [notxpcom, noscript] boolean EnumerateBackwards(in nsISupportsArrayEnumFunc aFunc, - in voidStar aData); + in voidPtr aData); %{C++ private: // NS_IMETHOD_(nsISupportsArray&) operator=(const nsISupportsArray& other) = 0; diff --git a/mozilla/xpcom/ds/nsISupportsPrimitives.idl b/mozilla/xpcom/ds/nsISupportsPrimitives.idl index 11faa27a49f..b0f153e09cb 100644 --- a/mozilla/xpcom/ds/nsISupportsPrimitives.idl +++ b/mozilla/xpcom/ds/nsISupportsPrimitives.idl @@ -152,11 +152,11 @@ interface nsISupportsDouble : nsISupports interface nsISupportsVoid : nsISupports { /* - * This would be: "[noscript] attribute voidStar data;" but for... + * This would be: "[noscript] attribute voidPtr data;" but for... * http://bugzilla.mozilla.org/show_bug.cgi?id=11454 */ - [noscript] void GetData([shared,retval] out voidStar aData); - [noscript] void SetData(in voidStar aData); + [noscript] void GetData([shared,retval] out voidPtr aData); + [noscript] void SetData(in voidPtr aData); string toString(); }; diff --git a/mozilla/xpcom/ds/nsImmutableString.h b/mozilla/xpcom/ds/nsImmutableString.h index d4c44a44e16..53693166ef8 100644 --- a/mozilla/xpcom/ds/nsImmutableString.h +++ b/mozilla/xpcom/ds/nsImmutableString.h @@ -94,7 +94,7 @@ protected: /** * Overloaded in order to get extra bytes for data. - * This needs to use our standard nsAllocator (rickg) + * This needs to use our standard nsMemory (rickg) * **/ void* operator new(size_t aSize,size_t additionalBytes) { diff --git a/mozilla/xpcom/ds/nsStr.cpp b/mozilla/xpcom/ds/nsStr.cpp index 906267b01f8..823aa3e95a2 100644 --- a/mozilla/xpcom/ds/nsStr.cpp +++ b/mozilla/xpcom/ds/nsStr.cpp @@ -664,7 +664,7 @@ PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) { aDest.mCapacity=theNewCapacity++; PRUint32 theSize=(theNewCapacity< #include #include "plhash.h" @@ -493,8 +493,8 @@ inline void AddNullTerminator(nsStr& aDest) { * Return the given buffer to the heap manager. Calls allocator::Free() * @return string length */ -inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); } -inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); } +inline void Recycle( char* aBuffer) { nsMemory::Free(aBuffer); } +inline void Recycle( PRUnichar* aBuffer) { nsMemory::Free(aBuffer); } /** * This method is used to access a given char in the given string diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index 38f5624e0de..07e82de4e98 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -662,7 +662,7 @@ char* nsCString::ToNewCString() const { * @return ptr to new ascii string */ PRUnichar* nsCString::ToNewUnicode() const { - PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsAllocator::Alloc(sizeof(PRUnichar) * (mLength + 1))); + PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsMemory::Alloc(sizeof(PRUnichar) * (mLength + 1))); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsAutoString temp(desc); diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp index af9d4aff01f..05b32a47dda 100644 --- a/mozilla/xpcom/ds/nsString2.cpp +++ b/mozilla/xpcom/ds/nsString2.cpp @@ -719,7 +719,7 @@ nsString* nsString::ToNewString() const { * @return ptr to new ascii string */ char* nsString::ToNewCString() const { - char* result = NS_STATIC_CAST(char*, nsAllocator::Alloc(mLength + 1)); + char* result = NS_STATIC_CAST(char*, nsMemory::Alloc(mLength + 1)); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsCAutoString temp(desc); diff --git a/mozilla/xpcom/ds/nsString2x.cpp b/mozilla/xpcom/ds/nsString2x.cpp index 7ab023922ca..a49a21659ba 100644 --- a/mozilla/xpcom/ds/nsString2x.cpp +++ b/mozilla/xpcom/ds/nsString2x.cpp @@ -3,7 +3,7 @@ #include "nsBufferManager.h" #include #include -#include "nsIAllocator.h" +#include "nsMemory.h" static const char* kNullPointerError = "Unexpected null pointer"; static const char* kWhitespace="\b\t\r\n "; @@ -1105,7 +1105,7 @@ PRUint32 HashCode(const nsString& aDest) { } void Recycle( PRUnichar* aBuffer) { - nsAllocator::Free(aBuffer); + nsMemory::Free(aBuffer); } diff --git a/mozilla/xpcom/ds/nsStringValue.h b/mozilla/xpcom/ds/nsStringValue.h index 9c984369cbb..6fc9b648d33 100644 --- a/mozilla/xpcom/ds/nsStringValue.h +++ b/mozilla/xpcom/ds/nsStringValue.h @@ -1,4 +1,4 @@ - +! /************************************************************************************* * * MODULES NOTES: @@ -23,7 +23,7 @@ #include "nsIAtom.h" #include "nscore.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include #if 0 diff --git a/mozilla/xpcom/ds/nsStringx.cpp b/mozilla/xpcom/ds/nsStringx.cpp index e03f6311658..09333205b48 100644 --- a/mozilla/xpcom/ds/nsStringx.cpp +++ b/mozilla/xpcom/ds/nsStringx.cpp @@ -3,7 +3,7 @@ #include "nsBufferManager.h" #include #include -#include "nsIAllocator.h" +#include "nsMemory.h" static const char* kWhitespace="\b\t\r\n "; @@ -1005,7 +1005,7 @@ PRUint32 HashCode(const nsCString& aDest) { } void Recycle( char* aBuffer) { - nsAllocator::Free(aBuffer); + nsMemory::Free(aBuffer); } /***************************************************************** diff --git a/mozilla/xpcom/ds/nsSupportsPrimitives.cpp b/mozilla/xpcom/ds/nsSupportsPrimitives.cpp index 5199e205997..9fa2fdbbb19 100644 --- a/mozilla/xpcom/ds/nsSupportsPrimitives.cpp +++ b/mozilla/xpcom/ds/nsSupportsPrimitives.cpp @@ -22,7 +22,7 @@ #include "nsSupportsPrimitives.h" #include "nsCRT.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "prprf.h" /***************************************************************************/ @@ -38,7 +38,7 @@ nsSupportsIDImpl::nsSupportsIDImpl() nsSupportsIDImpl::~nsSupportsIDImpl() { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); } NS_IMETHODIMP nsSupportsIDImpl::GetData(nsID **aData) @@ -50,7 +50,7 @@ NS_IMETHODIMP nsSupportsIDImpl::GetData(nsID **aData) } if(mData) { - *aData = (nsID*) nsAllocator::Clone(mData, sizeof(nsID)); + *aData = (nsID*) nsMemory::Clone(mData, sizeof(nsID)); return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } else @@ -63,9 +63,9 @@ NS_IMETHODIMP nsSupportsIDImpl::GetData(nsID **aData) NS_IMETHODIMP nsSupportsIDImpl::SetData(const nsID *aData) { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); if(aData) - mData = (nsID*) nsAllocator::Clone(aData, sizeof(nsID)); + mData = (nsID*) nsMemory::Clone(aData, sizeof(nsID)); else mData = nsnull; return NS_OK; @@ -84,7 +84,7 @@ NS_IMETHODIMP nsSupportsIDImpl::ToString(char **_retval) char * str = mData->ToString(); if(str) { - result = (char*) nsAllocator::Clone(str, + result = (char*) nsMemory::Clone(str, (nsCRT::strlen(str)+1)*sizeof(char)); delete [] str; } @@ -92,7 +92,7 @@ NS_IMETHODIMP nsSupportsIDImpl::ToString(char **_retval) else { static const char nullStr[] = "null"; - result = (char*) nsAllocator::Clone(nullStr, sizeof(nullStr)); + result = (char*) nsMemory::Clone(nullStr, sizeof(nullStr)); } *_retval = result; @@ -113,7 +113,7 @@ nsSupportsStringImpl::nsSupportsStringImpl() nsSupportsStringImpl::~nsSupportsStringImpl() { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); } NS_IMETHODIMP nsSupportsStringImpl::GetData(char **aData) @@ -125,7 +125,7 @@ NS_IMETHODIMP nsSupportsStringImpl::GetData(char **aData) } if(mData) { - *aData = (char*) nsAllocator::Clone(mData, + *aData = (char*) nsMemory::Clone(mData, (nsCRT::strlen(mData)+1)*sizeof(char)); return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -149,9 +149,9 @@ NS_IMETHODIMP nsSupportsStringImpl::ToString(char **_retval) NS_IMETHODIMP nsSupportsStringImpl::SetDataWithLength(PRUint32 aLength, const char *aData) { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); if(aData) { - mData = NS_STATIC_CAST(char*, nsAllocator::Alloc((aLength+1)*sizeof(char))); + mData = NS_STATIC_CAST(char*, nsMemory::Alloc((aLength+1)*sizeof(char))); if ( mData ) { nsCRT::memcpy ( mData, aData, aLength*sizeof(char) ); mData[aLength] = NS_STATIC_CAST(char, 0); @@ -177,7 +177,7 @@ nsSupportsWStringImpl::nsSupportsWStringImpl() nsSupportsWStringImpl::~nsSupportsWStringImpl() { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); } NS_IMETHODIMP nsSupportsWStringImpl::GetData(PRUnichar **aData) @@ -189,7 +189,7 @@ NS_IMETHODIMP nsSupportsWStringImpl::GetData(PRUnichar **aData) } if(mData) { - *aData = (PRUnichar*) nsAllocator::Clone(mData, + *aData = (PRUnichar*) nsMemory::Clone(mData, (nsCRT::strlen(mData)+1)*sizeof(PRUnichar)); return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -215,9 +215,9 @@ NS_IMETHODIMP nsSupportsWStringImpl::ToString(PRUnichar **_retval) NS_IMETHODIMP nsSupportsWStringImpl::SetDataWithLength(PRUint32 aLength, const PRUnichar *aData) { if(mData) - nsAllocator::Free(mData); + nsMemory::Free(mData); if(aData) { - mData = NS_STATIC_CAST(PRUnichar*, nsAllocator::Alloc((aLength+1)*sizeof(PRUnichar))); + mData = NS_STATIC_CAST(PRUnichar*, nsMemory::Alloc((aLength+1)*sizeof(PRUnichar))); if ( mData ) { nsCRT::memcpy ( mData, aData, aLength*sizeof(PRUnichar) ); mData[aLength] = NS_STATIC_CAST(PRUnichar, 0); @@ -268,7 +268,7 @@ NS_IMETHODIMP nsSupportsPRBoolImpl::ToString(char **_retval) return NS_ERROR_NULL_POINTER; } const char * str = mData ? "true" : "false"; - char* result = (char*) nsAllocator::Clone(str, + char* result = (char*) nsMemory::Clone(str, (nsCRT::strlen(str)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -330,7 +330,7 @@ NS_IMETHODIMP nsSupportsPRUint8Impl::ToString(char **_retval) PR_snprintf(buf, size, "%u", (PRUint16) mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -377,7 +377,7 @@ NS_IMETHODIMP nsSupportsPRUint16Impl::ToString(char **_retval) PR_snprintf(buf, size, "%u", (int) mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -424,7 +424,7 @@ NS_IMETHODIMP nsSupportsPRUint32Impl::ToString(char **_retval) PR_snprintf(buf, size, "%lu", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -471,7 +471,7 @@ NS_IMETHODIMP nsSupportsPRUint64Impl::ToString(char **_retval) PR_snprintf(buf, size, "%llu", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -518,7 +518,7 @@ NS_IMETHODIMP nsSupportsPRTimeImpl::ToString(char **_retval) PR_snprintf(buf, size, "%llu", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -562,7 +562,7 @@ NS_IMETHODIMP nsSupportsCharImpl::ToString(char **_retval) return NS_ERROR_NULL_POINTER; } - if(nsnull != (result = (char*) nsAllocator::Alloc(2*sizeof(char)))) + if(nsnull != (result = (char*) nsMemory::Alloc(2*sizeof(char)))) { result[0] = mData; result[1] = '\0'; @@ -612,7 +612,7 @@ NS_IMETHODIMP nsSupportsPRInt16Impl::ToString(char **_retval) PR_snprintf(buf, size, "%d", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -659,7 +659,7 @@ NS_IMETHODIMP nsSupportsPRInt32Impl::ToString(char **_retval) PR_snprintf(buf, size, "%ld", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -706,7 +706,7 @@ NS_IMETHODIMP nsSupportsPRInt64Impl::ToString(char **_retval) PR_snprintf(buf, size, "%lld", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -753,7 +753,7 @@ NS_IMETHODIMP nsSupportsFloatImpl::ToString(char **_retval) PR_snprintf(buf, size, "%f", (double) mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -800,7 +800,7 @@ NS_IMETHODIMP nsSupportsDoubleImpl::ToString(char **_retval) PR_snprintf(buf, size, "%f", mData); - char* result = (char*) nsAllocator::Clone(buf, + char* result = (char*) nsMemory::Clone(buf, (nsCRT::strlen(buf)+1)*sizeof(char)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; @@ -845,7 +845,7 @@ NS_IMETHODIMP nsSupportsVoidImpl::ToString(char **_retval) } static const char str[] = "[raw data]"; - char* result = (char*) nsAllocator::Clone(str, sizeof(str)); + char* result = (char*) nsMemory::Clone(str, sizeof(str)); *_retval = result; return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/xpcom/ds/nsXPIDLString.cpp b/mozilla/xpcom/ds/nsXPIDLString.cpp index 4e23edce83d..1ef8e962683 100644 --- a/mozilla/xpcom/ds/nsXPIDLString.cpp +++ b/mozilla/xpcom/ds/nsXPIDLString.cpp @@ -21,14 +21,14 @@ */ #include "nsDebug.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsXPIDLString.h" #include "plstr.h" // If the allocator changes, fix it here. -#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar))) -#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char))) -#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr)) +#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsMemory::Alloc((__len) * sizeof(PRUnichar))) +#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsMemory::Alloc((__len) * sizeof(char))) +#define XPIDL_FREE(__ptr) (nsMemory::Free(__ptr)) //////////////////////////////////////////////////////////////////////// // nsXPIDLString diff --git a/mozilla/xpcom/ds/nsXPIDLString.h b/mozilla/xpcom/ds/nsXPIDLString.h index 3ac35b130e8..3cd75524e17 100644 --- a/mozilla/xpcom/ds/nsXPIDLString.h +++ b/mozilla/xpcom/ds/nsXPIDLString.h @@ -48,7 +48,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - nsAllocator::Free(bar); + nsMemory::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -62,7 +62,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to nsAllocator::Free(). + // no need to remember to nsMemory::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an diff --git a/mozilla/xpcom/io/nsBinaryStream.cpp b/mozilla/xpcom/io/nsBinaryStream.cpp index e28dde42f60..c79147b3e3b 100644 --- a/mozilla/xpcom/io/nsBinaryStream.cpp +++ b/mozilla/xpcom/io/nsBinaryStream.cpp @@ -34,7 +34,7 @@ * @See nsIBinaryOutputStream */ #include "nsBinaryStream.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include // Swap macros, used to convert to/from canonical (big-endian) format @@ -333,7 +333,7 @@ nsBinaryInputStream::ReadBytes(char* *aString, PRUint32 aLength) PRUint32 bytesRead; char* s; - s = (char*)nsAllocator::Alloc(aLength); + s = (char*)nsMemory::Alloc(aLength); if (!s) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/xpcom/io/nsByteArrayInputStream.cpp b/mozilla/xpcom/io/nsByteArrayInputStream.cpp index fb834d47588..8de49f62369 100644 --- a/mozilla/xpcom/io/nsByteArrayInputStream.cpp +++ b/mozilla/xpcom/io/nsByteArrayInputStream.cpp @@ -20,7 +20,7 @@ */ #include "nsByteArrayInputStream.h" -#include "nsIAllocator.h" +#include "nsMemory.h" NS_IMPL_THREADSAFE_ISUPPORTS3(nsByteArrayInputStream, nsIInputStream, nsIBaseStream, nsIByteArrayInputStream) @@ -33,7 +33,7 @@ nsByteArrayInputStream::nsByteArrayInputStream (char *buffer, PRUint32 bytes) nsByteArrayInputStream::~nsByteArrayInputStream () { if (_buffer != NULL) - nsAllocator::Free (_buffer); + nsMemory::Free (_buffer); } NS_IMETHODIMP @@ -80,7 +80,7 @@ nsByteArrayInputStream::Close () { if (_buffer != NULL) { - nsAllocator::Free (_buffer); + nsMemory::Free (_buffer); _buffer = NULL; _nbytes = 0; } diff --git a/mozilla/xpcom/io/nsEscape.cpp b/mozilla/xpcom/io/nsEscape.cpp index 5a8788118a2..d0f67cce347 100644 --- a/mozilla/xpcom/io/nsEscape.cpp +++ b/mozilla/xpcom/io/nsEscape.cpp @@ -23,7 +23,7 @@ // First checked in on 98/12/03 by John R. McMullen, derived from net.h/mkparse.c. #include "nsEscape.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsCRT.h" const int netCharType[256] = @@ -86,7 +86,7 @@ NS_COM char* nsEscapeCount( extra += 2; /* the escape, plus an extra byte for each nibble */ } - char* result = (char *)nsAllocator::Alloc(len + extra + 1); + char* result = (char *)nsMemory::Alloc(len + extra + 1); if (!result) return 0; @@ -174,7 +174,7 @@ NS_COM PRInt32 nsUnescapeCount(char * str) NS_COM char * nsEscapeHTML(const char * string) { - char *rv = (char *) nsAllocator::Alloc(nsCRT::strlen(string)*6 + 1); /* The +1 is for the trailing null! */ + char *rv = (char *) nsMemory::Alloc(nsCRT::strlen(string)*6 + 1); /* The +1 is for the trailing null! */ char *ptr = rv; if(rv) diff --git a/mozilla/xpcom/io/nsFileSpec.cpp b/mozilla/xpcom/io/nsFileSpec.cpp index 7f1c1973fe4..7865dd5f209 100644 --- a/mozilla/xpcom/io/nsFileSpec.cpp +++ b/mozilla/xpcom/io/nsFileSpec.cpp @@ -24,7 +24,7 @@ #include "nsDebug.h" #include "nsEscape.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "prtypes.h" #include "plstr.h" @@ -1362,7 +1362,7 @@ void nsPersistentFileDescriptor::SetData(const char* inData, PRInt32 inSize) nsAutoCString::~nsAutoCString() //---------------------------------------------------------------------------------------- { - nsAllocator::Free(NS_REINTERPRET_CAST(void*, NS_CONST_CAST(char*, mCString))); + nsMemory::Free(NS_REINTERPRET_CAST(void*, NS_CONST_CAST(char*, mCString))); } //======================================================================================== diff --git a/mozilla/xpcom/io/nsIBufferInputStream.idl b/mozilla/xpcom/io/nsIBufferInputStream.idl index fbfbf57df09..8a423f785f2 100644 --- a/mozilla/xpcom/io/nsIBufferInputStream.idl +++ b/mozilla/xpcom/io/nsIBufferInputStream.idl @@ -54,7 +54,7 @@ interface nsIBufferInputStream : nsIInputStream [noscript] unsigned long ReadSegments(in nsWriteSegmentFun writer, - in voidStar closure, + in voidPtr closure, in unsigned long count); /** diff --git a/mozilla/xpcom/io/nsIBufferOutputStream.idl b/mozilla/xpcom/io/nsIBufferOutputStream.idl index 23bc81daf54..8d311bbb6e7 100644 --- a/mozilla/xpcom/io/nsIBufferOutputStream.idl +++ b/mozilla/xpcom/io/nsIBufferOutputStream.idl @@ -53,7 +53,7 @@ interface nsIBufferOutputStream : nsIOutputStream readonly attribute nsIBuffer Buffer; [noscript] unsigned long WriteSegments(in nsReadSegmentFun reader, - in voidStar closure, + in voidPtr closure, in unsigned long count); /** diff --git a/mozilla/xpcom/io/nsIInputStream.idl b/mozilla/xpcom/io/nsIInputStream.idl index 6493cabdde2..0ab2c6aaf9a 100644 --- a/mozilla/xpcom/io/nsIInputStream.idl +++ b/mozilla/xpcom/io/nsIInputStream.idl @@ -39,5 +39,5 @@ interface nsIInputStream : nsIBaseStream * bytes read, eof if 0. if an error occurs, the * read count will be undefined */ - [noscript] unsigned long Read(in charStar buf, in unsigned long count); + [noscript] unsigned long Read(in charPtr buf, in unsigned long count); }; diff --git a/mozilla/xpcom/io/nsIPipe.idl b/mozilla/xpcom/io/nsIPipe.idl index 4de972b05c2..31db264671b 100644 --- a/mozilla/xpcom/io/nsIPipe.idl +++ b/mozilla/xpcom/io/nsIPipe.idl @@ -23,7 +23,7 @@ #include "nsISupports.idl" interface nsIPipe; -interface nsIAllocator; +interface nsIMemory; interface nsIBufferInputStream; interface nsIBufferOutputStream; @@ -41,7 +41,7 @@ interface nsIPipe : nsISupports { void initialize(in unsigned long segmentSize, in unsigned long maxSize, in nsIPipeObserver observer, - in nsIAllocator segmentAllocator); + in nsIMemory segmentAllocator); readonly attribute nsIBufferInputStream inputStream; readonly attribute nsIBufferOutputStream outputStream; attribute nsIPipeObserver observer; diff --git a/mozilla/xpcom/io/nsIStorageStream.idl b/mozilla/xpcom/io/nsIStorageStream.idl index 2bb757a0674..2226aa71dfa 100644 --- a/mozilla/xpcom/io/nsIStorageStream.idl +++ b/mozilla/xpcom/io/nsIStorageStream.idl @@ -22,7 +22,6 @@ #include "nsISupports.idl" #include "nsrootidl.idl" -interface nsIAllocator; interface nsIInputStream; interface nsIOutputStream; diff --git a/mozilla/xpcom/io/nsLinebreakConverter.cpp b/mozilla/xpcom/io/nsLinebreakConverter.cpp index c32bee5604b..68c299b39b5 100644 --- a/mozilla/xpcom/io/nsLinebreakConverter.cpp +++ b/mozilla/xpcom/io/nsLinebreakConverter.cpp @@ -22,7 +22,7 @@ #include "nsLinebreakConverter.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsCRT.h" @@ -117,7 +117,7 @@ static T* ConvertBreaks(const T* inSrc, PRInt32& ioLen, const char* srcBreak, co // handle the no conversion case if (nsCRT::strcmp(srcBreak, destBreak) == 0) { - resultString = (T *)nsAllocator::Alloc(sizeof(T) * ioLen); + resultString = (T *)nsMemory::Alloc(sizeof(T) * ioLen); if (!resultString) return nsnull; nsCRT::memcpy(resultString, inSrc, sizeof(T) * ioLen); // includes the null, if any return resultString; @@ -130,7 +130,7 @@ static T* ConvertBreaks(const T* inSrc, PRInt32& ioLen, const char* srcBreak, co // breaks are only 1 char long, i.e. CR <-> LF if (srcBreakLen == destBreakLen && srcBreakLen == 1) { - resultString = (T *)nsAllocator::Alloc(sizeof(T) * ioLen); + resultString = (T *)nsMemory::Alloc(sizeof(T) * ioLen); if (!resultString) return nsnull; const T* src = inSrc; @@ -163,7 +163,7 @@ static T* ConvertBreaks(const T* inSrc, PRInt32& ioLen, const char* srcBreak, co PRInt32 numLinebreaks = CountLinebreaks(inSrc, ioLen, srcBreak); PRInt32 newBufLen = ioLen - (numLinebreaks * srcBreakLen) + (numLinebreaks * destBreakLen); - resultString = (T *)nsAllocator::Alloc(sizeof(T) * newBufLen); + resultString = (T *)nsMemory::Alloc(sizeof(T) * newBufLen); if (!resultString) return nsnull; const T* src = inSrc; @@ -261,7 +261,7 @@ static T* ConvertUnknownBreaks(const T* inSrc, PRInt32& ioLen, const char* destB src ++; } - T* resultString = (T *)nsAllocator::Alloc(sizeof(T) * finalLen); + T* resultString = (T *)nsMemory::Alloc(sizeof(T) * finalLen); if (!resultString) return nsnull; src = inSrc; @@ -472,7 +472,7 @@ nsresult nsLinebreakConverter::ConvertStringLineBreaks(nsString& ioString, if (stringBuf != ioString.mUStr) // we reallocated { // this is pretty evil. Is there a better way? - nsAllocator::Free(ioString.mUStr); + nsMemory::Free(ioString.mUStr); ioString.mUStr = stringBuf; ioString.mLength = newLen - 1; ioString.mCapacity = newLen; @@ -488,7 +488,7 @@ nsresult nsLinebreakConverter::ConvertStringLineBreaks(nsString& ioString, if (stringBuf != ioString.mStr) // we reallocated { - nsAllocator::Free(ioString.mStr); + nsMemory::Free(ioString.mStr); ioString.mStr = stringBuf; ioString.mLength = newLen - 1; ioString.mCapacity = newLen; diff --git a/mozilla/xpcom/io/nsLocalFileCommon.cpp b/mozilla/xpcom/io/nsLocalFileCommon.cpp index 7a551537839..24ab363ccd7 100644 --- a/mozilla/xpcom/io/nsLocalFileCommon.cpp +++ b/mozilla/xpcom/io/nsLocalFileCommon.cpp @@ -76,7 +76,7 @@ private: nsresult res; \ if(NS_SUCCEEDED(res = (func)(&tmp))) { \ if(NS_SUCCEEDED(res = gConverter.FSToNewUCS(tmp, (arg)))){ \ - nsAllocator::Free(tmp); \ + nsMemory::Free(tmp); \ } \ } \ return res; \ @@ -87,7 +87,7 @@ private: nsresult res; \ if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((arg), &tmp))) { \ (func)(tmp); \ - nsAllocator::Free(tmp); \ + nsMemory::Free(tmp); \ } \ NS_ASSERTION(NS_SUCCEEDED(res), assertion_msg); \ } @@ -97,7 +97,7 @@ private: nsresult res; \ if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((arg), &tmp))) { \ res = (func)(tmp); \ - nsAllocator::Free(tmp); \ + nsMemory::Free(tmp); \ } \ return res; \ } @@ -107,7 +107,7 @@ private: nsresult res; \ if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((arg2), &tmp))){ \ res = (func)(arg1, tmp); \ - nsAllocator::Free(tmp); \ + nsMemory::Free(tmp); \ } \ return res; \ } @@ -117,7 +117,7 @@ private: nsresult res; \ if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((arg1), &tmp))){ \ res = (func)(tmp, arg2); \ - nsAllocator::Free(tmp); \ + nsMemory::Free(tmp); \ } \ return res; \ } @@ -206,13 +206,13 @@ nsFSStringConversion::UCSToNewFS( const PRUnichar* aIn, char** aOut) PRInt32 outLength; res= mEncoder->GetMaxLength(aIn, inLength,&outLength); if(NS_SUCCEEDED(res)) { - *aOut = (char*)nsAllocator::Alloc(outLength+1); + *aOut = (char*)nsMemory::Alloc(outLength+1); if(nsnull != aOut) { res = mEncoder->Convert(aIn, &inLength, *aOut, &outLength); if(NS_SUCCEEDED(res)) { (*aOut)[outLength] = '\0'; } else { - nsAllocator::Free(*aOut); + nsMemory::Free(*aOut); aOut = nsnull; } } else { @@ -235,13 +235,13 @@ nsFSStringConversion::FSToNewUCS( const char* aIn, PRUnichar** aOut) PRInt32 outLength; res= mDecoder->GetMaxLength(aIn, inLength,&outLength); if(NS_SUCCEEDED(res)) { - *aOut = (PRUnichar*)nsAllocator::Alloc(2*(outLength+1)); + *aOut = (PRUnichar*)nsMemory::Alloc(2*(outLength+1)); if(nsnull != aOut) { res = mDecoder->Convert(aIn, &inLength, *aOut, &outLength); if(NS_SUCCEEDED(res)) { (*aOut)[outLength] = '\0'; } else { - nsAllocator::Free(*aOut); + nsMemory::Free(*aOut); aOut = nsnull; } } else { @@ -320,7 +320,7 @@ void nsFileSpec::operator = (const nsString& inNativePath) nsresult res; if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((inNativePath.GetUnicode()), &tmp))) { *this = tmp; - nsAllocator::Free(tmp); + nsMemory::Free(tmp); } mError = res; NS_ASSERTION(NS_SUCCEEDED(res), "nsFileSpec = filed"); @@ -333,7 +333,7 @@ nsFileSpec nsFileSpec::operator + (const nsString& inRelativeUnixPath) const if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((inRelativeUnixPath.GetUnicode()), &tmp))) { resultSpec = *this; resultSpec += tmp; - nsAllocator::Free(tmp); + nsMemory::Free(tmp); } NS_ASSERTION(NS_SUCCEEDED(res), "nsFileSpec + filed"); return resultSpec; @@ -344,7 +344,7 @@ void nsFileSpec::operator += (const nsString& inRelativeUnixPath) nsresult res; if(NS_SUCCEEDED(res = gConverter.UCSToNewFS((inRelativeUnixPath.GetUnicode()), &tmp))) { *this += tmp; - nsAllocator::Free(tmp); + nsMemory::Free(tmp); } mError = res; NS_ASSERTION(NS_SUCCEEDED(res), "nsFileSpec + filed"); diff --git a/mozilla/xpcom/io/nsLocalFileMac.cpp b/mozilla/xpcom/io/nsLocalFileMac.cpp index ed40d45d0ea..1a805c86a62 100644 --- a/mozilla/xpcom/io/nsLocalFileMac.cpp +++ b/mozilla/xpcom/io/nsLocalFileMac.cpp @@ -25,7 +25,7 @@ #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsLocalFileMac.h" @@ -835,9 +835,9 @@ nsLocalFile::ResolveAndStat(PRBool resolveTerminal) { case eInitWithPath: { - filePath = (char *)nsAllocator::Clone(mWorkingPath, strlen(mWorkingPath)+1); + filePath = (char *)nsMemory::Clone(mWorkingPath, strlen(mWorkingPath)+1); err = ResolvePathAndSpec(filePath, nsnull, PR_FALSE, &mResolvedSpec); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); break; } @@ -845,9 +845,9 @@ nsLocalFile::ResolveAndStat(PRBool resolveTerminal) { if (strlen(mAppendedPath)) { // We've got an FSSpec and an appended path so pass 'em both to ResolvePathAndSpec - filePath = (char *)nsAllocator::Clone(mAppendedPath, strlen(mAppendedPath)+1); + filePath = (char *)nsMemory::Clone(mAppendedPath, strlen(mAppendedPath)+1); err = ResolvePathAndSpec(filePath, &mSpec, PR_FALSE, &mResolvedSpec); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); } else { @@ -913,7 +913,7 @@ nsLocalFile::Clone(nsIFile **file) char *path; GetPath(&path); rv = localFile->InitWithPath(path); - nsAllocator::Free(path); + nsMemory::Free(path); break; case eInitWithFSSpec: @@ -925,7 +925,7 @@ nsLocalFile::Clone(nsIFile **file) char *appendedPath; GetAppendedPath(&appendedPath); rv = localFileMac->SetAppendedPath(appendedPath); - nsAllocator::Free(appendedPath); + nsMemory::Free(appendedPath); break; default: @@ -1066,9 +1066,9 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes) { case eInitWithPath: { - filePath = (char *)nsAllocator::Clone(mWorkingPath, strlen(mWorkingPath)+1); + filePath = (char *)nsMemory::Clone(mWorkingPath, strlen(mWorkingPath)+1); err = ResolvePathAndSpec(filePath, nsnull, PR_TRUE, &mResolvedSpec); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); break; } @@ -1076,9 +1076,9 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes) { if (strlen(mAppendedPath)) { // We've got an FSSpec and an appended path so pass 'em both to ResolvePathAndSpec - filePath = (char *)nsAllocator::Clone(mAppendedPath, strlen(mAppendedPath)+1); + filePath = (char *)nsMemory::Clone(mAppendedPath, strlen(mAppendedPath)+1); err = ResolvePathAndSpec(filePath, &mSpec, PR_TRUE, &mResolvedSpec); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); } else { @@ -1184,7 +1184,7 @@ nsLocalFile::GetLeafName(char * *aLeafName) else leaf++; - *aLeafName = (char*) nsAllocator::Clone(leaf, strlen(leaf)+1); + *aLeafName = (char*) nsMemory::Clone(leaf, strlen(leaf)+1); break; case eInitWithFSSpec: @@ -1203,14 +1203,14 @@ nsLocalFile::GetLeafName(char * *aLeafName) else leaf++; - *aLeafName = (char*) nsAllocator::Clone(leaf, strlen(leaf)+1); + *aLeafName = (char*) nsMemory::Clone(leaf, strlen(leaf)+1); } else { // We don't have an appended path so grab the leaf name from the FSSpec // Convert the Pascal string to a C string PRInt32 len = mSpec.name[0]; - char* leafName = (char *)nsAllocator::Alloc(len + 1); + char* leafName = (char *)nsMemory::Alloc(len + 1); if (!leafName) return NS_ERROR_OUT_OF_MEMORY; ::BlockMoveData(&mSpec.name[1], leafName, len); leafName[len] = '\0'; @@ -1281,7 +1281,7 @@ nsLocalFile::GetPath(char **_retval) switch (mInitType) { case eInitWithPath: - *_retval = (char*) nsAllocator::Clone(mWorkingPath, strlen(mWorkingPath)+1); + *_retval = (char*) nsMemory::Clone(mWorkingPath, strlen(mWorkingPath)+1); if (!*_retval) return NS_ERROR_OUT_OF_MEMORY; break; @@ -1295,7 +1295,7 @@ nsLocalFile::GetPath(char **_retval) if (!fullPathHandle) return NS_ERROR_OUT_OF_MEMORY; - char* fullPath = (char *)nsAllocator::Alloc(fullPathLen + 1); + char* fullPath = (char *)nsMemory::Alloc(fullPathLen + 1); if (!fullPath) return NS_ERROR_OUT_OF_MEMORY; @@ -1764,7 +1764,7 @@ nsLocalFile::GetParent(nsIFile * *aParent) localFileMac->QueryInterface(NS_GET_IID(nsIFile), (void**)aParent); } bail: - nsAllocator::Free(appendedPath); + nsMemory::Free(appendedPath); break; } @@ -1924,8 +1924,8 @@ nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval) if (strcmp(inFilePath, filePath) == 0) *_retval = PR_TRUE; - nsAllocator::Free(inFilePath); - nsAllocator::Free(filePath); + nsMemory::Free(inFilePath); + nsMemory::Free(filePath); return NS_OK; } @@ -1997,7 +1997,7 @@ nsLocalFile::GetTarget(char **_retval) return NS_ERROR_FILE_INVALID_PATH; } - *_retval = (char*) nsAllocator::Clone( mResolvedPath, strlen(mResolvedPath)+1 ); + *_retval = (char*) nsMemory::Clone( mResolvedPath, strlen(mResolvedPath)+1 ); return NS_OK; } @@ -2439,7 +2439,7 @@ NS_IMETHODIMP nsLocalFile::SetAppendedPath(const char *aPath) NS_IMETHODIMP nsLocalFile::GetAppendedPath(char **_retval) { NS_ENSURE_ARG_POINTER(_retval); - *_retval = (char*) nsAllocator::Clone(mAppendedPath, strlen(mAppendedPath)+1); + *_retval = (char*) nsMemory::Clone(mAppendedPath, strlen(mAppendedPath)+1); return NS_OK; } diff --git a/mozilla/xpcom/io/nsLocalFileOS2.cpp b/mozilla/xpcom/io/nsLocalFileOS2.cpp index 2257047b08c..08400ce137d 100644 --- a/mozilla/xpcom/io/nsLocalFileOS2.cpp +++ b/mozilla/xpcom/io/nsLocalFileOS2.cpp @@ -37,7 +37,7 @@ */ #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIComponentManager.h" #include "nsISimpleEnumerator.h" #include "nsIFile.h" @@ -110,7 +110,7 @@ class nsDirEnumerator : public nsISimpleEnumerator if (mDir == nsnull) // not a directory? return NS_ERROR_FAILURE; - nsAllocator::Free(filepath); + nsMemory::Free(filepath); mParent = parent; return NS_OK; @@ -239,7 +239,7 @@ nsLocalFile::Clone(nsIFile **file) nsCOMPtr localFile; rv = NS_NewLocalFile(aFilePath, getter_AddRefs(localFile)); - nsAllocator::Free(aFilePath); + nsMemory::Free(aFilePath); if (NS_SUCCEEDED(rv) && localFile) { @@ -271,7 +271,7 @@ nsLocalFile::InitWithPath(const char *filePath) if (NS_FAILED(rv)) return NS_ERROR_FILE_INVALID_PATH; } - nativeFilePath = (char*) nsAllocator::Clone( filePath, strlen(filePath)+1 ); + nativeFilePath = (char*) nsMemory::Clone( filePath, strlen(filePath)+1 ); } if (nativeFilePath == nsnull) @@ -284,7 +284,7 @@ nsLocalFile::InitWithPath(const char *filePath) temp[len] = '\0'; mPath.Assign(nativeFilePath); - nsAllocator::Free( nativeFilePath ); + nsMemory::Free( nativeFilePath ); return NS_OK; } @@ -434,7 +434,7 @@ nsLocalFile::GetLeafName(char **aLeafName) else leaf++; - *aLeafName = (char*)nsAllocator::Clone(leaf, strlen(leaf) + 1); + *aLeafName = (char*)nsMemory::Clone(leaf, strlen(leaf) + 1); return NS_OK; } @@ -463,7 +463,7 @@ NS_IMETHODIMP nsLocalFile::GetPath(char **_retval) { NS_ENSURE_ARG_POINTER(_retval); - *_retval = (char*)nsAllocator::Clone((const char*)mPath, strlen(mPath) + 1); + *_retval = (char*)nsMemory::Clone((const char*)mPath, strlen(mPath) + 1); return NS_OK; } @@ -485,7 +485,7 @@ nsLocalFile::CopyMove(nsIFile *newParentDir, const char *newName, PRBool move) char* inFilePath; newParentDir->GetTarget(&inFilePath); nsCString newPath = inFilePath; - nsAllocator::Free(inFilePath); + nsMemory::Free(inFilePath); PRUint32 lastc = strlen(newPath) - 1; @@ -555,7 +555,7 @@ nsLocalFile::Spawn(const char **args, PRUint32 count) rv = PR_CreateProcessDetached(mPath, my_argv, NULL, NULL); // free up our argv - nsAllocator::Free(my_argv); + nsMemory::Free(my_argv); if (PR_SUCCESS == rv) return NS_OK; @@ -928,8 +928,8 @@ nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval) if (strcmp(inFilePath, filePath) == 0) *_retval = PR_TRUE; - nsAllocator::Free(inFilePath); - nsAllocator::Free(filePath); + nsMemory::Free(inFilePath); + nsMemory::Free(filePath); return NS_OK; } @@ -961,8 +961,8 @@ nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) } - nsAllocator::Free(inFilePath); - nsAllocator::Free(myFilePath); + nsMemory::Free(inFilePath); + nsMemory::Free(myFilePath); return NS_OK; } @@ -972,7 +972,7 @@ nsLocalFile::GetTarget(char **_retval) { NS_ENSURE_ARG_POINTER(_retval); VALIDATE_STAT_CACHE(); - *_retval = (char*)nsAllocator::Clone((char*)mPath, strlen(mPath) + 1); + *_retval = (char*)nsMemory::Clone((char*)mPath, strlen(mPath) + 1); return NS_OK; } diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index f2161a29b20..d3466931496 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -45,7 +45,7 @@ #include "nsCRT.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIFile.h" #include "nsILocalFile.h" #include "nsLocalFileUnix.h" @@ -270,7 +270,7 @@ nsLocalFile::InitWithPath(const char *filePath) NS_ENSURE_ARG(filePath); int len = strlen(filePath); - char* name = (char*) nsAllocator::Clone( filePath, len+1 ); + char* name = (char*) nsMemory::Clone( filePath, len+1 ); if (name[len-1] == '/') { if (len != 1) name[len-1] = '\0'; @@ -278,7 +278,7 @@ nsLocalFile::InitWithPath(const char *filePath) mPath = name; - nsAllocator::Free(name); + nsMemory::Free(name); InvalidateCache(); return NS_OK; @@ -450,7 +450,7 @@ nsLocalFile::AppendRelativePath(const char *fragment) return NS_ERROR_FILE_UNRECOGNIZED_PATH; } - char * newPath = (char *)nsAllocator::Alloc(strlen(mPath) + + char * newPath = (char *)nsMemory::Alloc(strlen(mPath) + strlen(fragment) + 2); if (!newPath) return NS_ERROR_OUT_OF_MEMORY; @@ -459,7 +459,7 @@ nsLocalFile::AppendRelativePath(const char *fragment) strcat(newPath, fragment); mPath = newPath; InvalidateCache(); - nsAllocator::Free(newPath); + nsMemory::Free(newPath); return NS_OK; } @@ -526,7 +526,7 @@ nsLocalFile::SetLeafName(const char *aLeafName) char *leafName; if (NS_FAILED(rv = GetLeafNameRaw((const char**)&leafName))) return rv; - char* newPath = (char *)nsAllocator::Alloc(strlen(mPath) + + char* newPath = (char *)nsMemory::Alloc(strlen(mPath) + strlen(aLeafName) + 2); *leafName = 0; @@ -535,7 +535,7 @@ nsLocalFile::SetLeafName(const char *aLeafName) strcat(newPath, aLeafName); mPath = newPath; InvalidateCache(); - nsAllocator::Free(newPath); + nsMemory::Free(newPath); return NS_OK; } @@ -618,11 +618,11 @@ nsLocalFile::CopyTo(nsIFile *newParent, const char *newName) // this is the full path to the dir of the new file newPath = tmpChar; - nsAllocator::Free(tmpChar); + nsMemory::Free(tmpChar); // create the final name char *newPathName; - newPathName = (char *)nsAllocator::Alloc(strlen(newPath) + strlen(leafName) + 2); + newPathName = (char *)nsMemory::Alloc(strlen(newPath) + strlen(leafName) + 2); if (!newPathName) return NS_ERROR_OUT_OF_MEMORY; @@ -636,7 +636,7 @@ nsLocalFile::CopyTo(nsIFile *newParent, const char *newName) nsXPIDLCString newPathNameAuto; newPathNameAuto = newPathName; - nsAllocator::Free(newPathName); + nsMemory::Free(newPathName); // actually create the file. @@ -1231,7 +1231,7 @@ nsLocalFile::GetTarget(char **_retval) PRInt32 hi, lo; mLL_L2II(targetSize64, hi, lo); - char *target = (char *)nsAllocator::Alloc(lo); + char *target = (char *)nsMemory::Alloc(lo); if (!target) return NS_ERROR_OUT_OF_MEMORY; @@ -1240,7 +1240,7 @@ nsLocalFile::GetTarget(char **_retval) *_retval = target; return NS_OK; } - nsAllocator::Free(target); + nsMemory::Free(target); return NSRESULT_FOR_ERRNO(); } diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index 9b868f6e21b..15afb2169c5 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -24,7 +24,7 @@ #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsLocalFileWin.h" @@ -151,7 +151,7 @@ class nsDirEnumerator : public nsISimpleEnumerator if (mDir == nsnull) // not a directory? return NS_ERROR_FAILURE; - nsAllocator::Free(filepath); + nsMemory::Free(filepath); mParent = parent; return NS_OK; @@ -325,7 +325,7 @@ nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** // Get the native path for |this| - char* filePath = (char*) nsAllocator::Clone( workingPath, strlen(workingPath)+1 ); + char* filePath = (char*) nsMemory::Clone( workingPath, strlen(workingPath)+1 ); if (filePath == nsnull) return NS_ERROR_NULL_POINTER; @@ -347,15 +347,15 @@ nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** // we have a drive letter and a colon (eg 'c:' // this is resolve already - *resolvedPath = (char*) nsAllocator::Clone( filePath, strlen(filePath)+2 ); + *resolvedPath = (char*) nsMemory::Clone( filePath, strlen(filePath)+2 ); strcat(*resolvedPath, "\\"); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); return NS_OK; } else { - nsAllocator::Free(filePath); + nsMemory::Free(filePath); return NS_ERROR_FILE_INVALID_PATH; } } @@ -389,7 +389,7 @@ nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** // something is wrong. we should not have // both slash being null and resolveTerminal // not set! - nsAllocator::Free(filePath); + nsMemory::Free(filePath); return NS_ERROR_NULL_POINTER; } } @@ -425,7 +425,7 @@ nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** { WIN32_FIND_DATA wfd; - char *temp = (char*) nsAllocator::Alloc( MAX_PATH ); + char *temp = (char*) nsMemory::Alloc( MAX_PATH ); if (temp == nsnull) return NS_ERROR_NULL_POINTER; @@ -459,19 +459,19 @@ nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** slash = carot; } - nsAllocator::Free(filePath); + nsMemory::Free(filePath); filePath = temp; } else { - nsAllocator::Free(temp); + nsMemory::Free(temp); } } else { // could not resolve shortcut. Return error; - nsAllocator::Free(filePath); + nsMemory::Free(filePath); return NS_ERROR_FILE_INVALID_PATH; } } @@ -539,7 +539,7 @@ nsLocalFile::ResolveAndStat(PRBool resolveTerminal) return result; mResolvedPath.Assign(resolvePath); - nsAllocator::Free(resolvePath); + nsMemory::Free(resolvePath); // if we are not resolving the terminal node, we have to "fake" windows // out and append the ".lnk" file extension before getting any information @@ -571,7 +571,7 @@ nsLocalFile::Clone(nsIFile **file) nsCOMPtr localFile; rv = NS_NewLocalFile(aFilePath, getter_AddRefs(localFile)); - nsAllocator::Free(aFilePath); + nsMemory::Free(aFilePath); if (NS_SUCCEEDED(rv) && localFile) { @@ -596,7 +596,7 @@ nsLocalFile::InitWithPath(const char *filePath) if ( (filePath[2] == 0) && (filePath[1] == ':') ) { - nativeFilePath = (char*) nsAllocator::Clone( filePath, 4 ); + nativeFilePath = (char*) nsMemory::Clone( filePath, 4 ); // C : // nativeFilePath[2] = '\\'; } @@ -605,7 +605,7 @@ nsLocalFile::InitWithPath(const char *filePath) ( (filePath[0] == '\\') && (filePath[1] == '\\') ) ) // netwerk path { // This is a native path - nativeFilePath = (char*) nsAllocator::Clone( filePath, strlen(filePath)+1 ); + nativeFilePath = (char*) nsMemory::Clone( filePath, strlen(filePath)+1 ); } if (nativeFilePath == nsnull) @@ -619,7 +619,7 @@ nsLocalFile::InitWithPath(const char *filePath) temp[len] = '\0'; mWorkingPath.Assign(nativeFilePath); - nsAllocator::Free( nativeFilePath ); + nsMemory::Free( nativeFilePath ); return NS_OK; } @@ -749,7 +749,7 @@ nsLocalFile::GetLeafName(char * *aLeafName) else leaf++; - *aLeafName = (char*) nsAllocator::Clone(leaf, strlen(leaf)+1); + *aLeafName = (char*) nsMemory::Clone(leaf, strlen(leaf)+1); return NS_OK; } @@ -778,7 +778,7 @@ NS_IMETHODIMP nsLocalFile::GetPath(char **_retval) { NS_ENSURE_ARG_POINTER(_retval); - *_retval = (char*) nsAllocator::Clone(mWorkingPath, strlen(mWorkingPath)+1); + *_retval = (char*) nsMemory::Clone(mWorkingPath, strlen(mWorkingPath)+1); return NS_OK; } @@ -795,7 +795,7 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, const char char* inFilePath; destParent->GetTarget(&inFilePath); nsCString destPath = inFilePath; - nsAllocator::Free(inFilePath); + nsMemory::Free(inFilePath); destPath.Append("\\"); @@ -804,7 +804,7 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, const char char *aFileName; sourceFile->GetLeafName(&aFileName); destPath.Append(aFileName); - nsAllocator::Free(aFileName); + nsMemory::Free(aFileName); } else { @@ -836,7 +836,7 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, const char if (!copyOK) // CopyFile and MoveFile returns non-zero if succeeds (backward if you ask me). rv = ConvertWinError(GetLastError()); - nsAllocator::Free(filePath); + nsMemory::Free(filePath); return rv; } @@ -901,7 +901,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const char *newName, PRBool followSym rv = realDest->InitWithPath(target); - nsAllocator::Free(target); + nsMemory::Free(target); if (NS_FAILED(rv)) return rv; @@ -950,7 +950,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const char *newName, PRBool followSym const char* leaf = (const char*) _mbsrchr((const unsigned char*) temp, '\\'); if (leaf[0] == '\\') leaf++; - allocatedNewName = (char*) nsAllocator::Clone( leaf, strlen(leaf)+1 ); + allocatedNewName = (char*) nsMemory::Clone( leaf, strlen(leaf)+1 ); } else { @@ -959,14 +959,14 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const char *newName, PRBool followSym } else { - allocatedNewName = (char*) nsAllocator::Clone( newName, strlen(newName)+1 ); + allocatedNewName = (char*) nsMemory::Clone( newName, strlen(newName)+1 ); } rv = target->Append(allocatedNewName); if (NS_FAILED(rv)) return rv; - nsAllocator::Free(allocatedNewName); + nsMemory::Free(allocatedNewName); target->Create(DIRECTORY_TYPE, 0644); // TODO, what permissions should we use if (NS_FAILED(rv)) @@ -1032,7 +1032,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const char *newName, PRBool followSym InitWithPath(newParentPath); Append(aFileName); - nsAllocator::Free(aFileName); + nsMemory::Free(aFileName); } else { @@ -1040,7 +1040,7 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const char *newName, PRBool followSym Append(newName); } - nsAllocator::Free(newParentPath); + nsMemory::Free(newParentPath); } return NS_OK; @@ -1096,7 +1096,7 @@ nsLocalFile::Spawn(const char **args, PRUint32 count) rv = PR_CreateProcessDetached(mResolvedPath, my_argv, NULL, NULL); // free up our argv - nsAllocator::Free(my_argv); + nsMemory::Free(my_argv); if (PR_SUCCESS == rv) return NS_OK; @@ -1586,7 +1586,7 @@ nsLocalFile::IsExecutable(PRBool *_retval) *_retval = PR_FALSE; } - nsAllocator::Free(path); + nsMemory::Free(path); return NS_OK; } @@ -1661,7 +1661,7 @@ nsLocalFile::IsSymlink(PRBool *_retval) *_retval = PR_TRUE; } - nsAllocator::Free(path); + nsMemory::Free(path); return NS_OK; } @@ -1701,8 +1701,8 @@ nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval) if (strcmp(inFilePath, filePath) == 0) *_retval = PR_TRUE; - nsAllocator::Free(inFilePath); - nsAllocator::Free(filePath); + nsMemory::Free(inFilePath); + nsMemory::Free(filePath); return NS_OK; } @@ -1734,8 +1734,8 @@ nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) } - nsAllocator::Free(inFilePath); - nsAllocator::Free(myFilePath); + nsMemory::Free(inFilePath); + nsMemory::Free(myFilePath); return NS_OK; } @@ -1761,7 +1761,7 @@ nsLocalFile::GetTarget(char **_retval) #endif ResolveAndStat(PR_TRUE); - *_retval = (char*) nsAllocator::Clone( mResolvedPath, strlen(mResolvedPath)+1 ); + *_retval = (char*) nsMemory::Clone( mResolvedPath, strlen(mResolvedPath)+1 ); return NS_OK; } diff --git a/mozilla/xpcom/io/nsPipe2.cpp b/mozilla/xpcom/io/nsPipe2.cpp index c0df2343d35..0ecf0a7f641 100644 --- a/mozilla/xpcom/io/nsPipe2.cpp +++ b/mozilla/xpcom/io/nsPipe2.cpp @@ -103,7 +103,7 @@ public: // nsIPipe methods: NS_IMETHOD Initialize(PRUint32 segmentSize, PRUint32 maxSize, - nsIPipeObserver *observer, nsIAllocator *segmentAllocator) { + nsIPipeObserver *observer, nsIMemory *segmentAllocator) { nsresult rv; rv = mBuffer.Init(segmentSize, maxSize, segmentAllocator); if (NS_FAILED(rv)) return rv; @@ -799,7 +799,7 @@ nsPipe::nsPipeOutputStream::SetNonBlocking(PRBool aNonBlocking) #ifdef PAGE_MANAGER static NS_DEFINE_CID(kPageManagerCID, NS_PAGEMANAGER_CID); #endif -static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID); +static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); NS_COM nsresult NS_NewPipe(nsIBufferInputStream* *inStrResult, @@ -811,7 +811,7 @@ NS_NewPipe(nsIBufferInputStream* *inStrResult, nsresult rv; NS_ASSERTION(segmentSize > 0, "need to supply segmentSize for buffer"); NS_ASSERTION(maxSize > 0, "need to supply maxSize for buffer"); - const nsCID* cid = &kAllocatorCID; + const nsCID* cid = &kMemoryCID; #ifdef PAGE_MANAGER // Take the page manager out altogether because some unices don't // know how to reserve VM -- only preallocate it which takes up a lot @@ -824,7 +824,7 @@ NS_NewPipe(nsIBufferInputStream* *inStrResult, } #endif #endif - NS_WITH_SERVICE(nsIAllocator, alloc, *cid, &rv); + NS_WITH_SERVICE(nsIMemory, alloc, *cid, &rv); if (NS_FAILED(rv)) return rv; nsPipe* pipe = new nsPipe(); diff --git a/mozilla/xpcom/io/nsScriptableInputStream.cpp b/mozilla/xpcom/io/nsScriptableInputStream.cpp index 78135a112d0..d34b8cf0481 100644 --- a/mozilla/xpcom/io/nsScriptableInputStream.cpp +++ b/mozilla/xpcom/io/nsScriptableInputStream.cpp @@ -21,7 +21,7 @@ */ #include "nsScriptableInputStream.h" -#include "nsIAllocator.h" +#include "nsMemory.h" NS_IMPL_ISUPPORTS2(nsScriptableInputStream, nsIBaseStream, nsIScriptableInputStream); @@ -58,13 +58,13 @@ nsScriptableInputStream::Read(PRUint32 aCount, char **_retval) { if (NS_FAILED(rv)) return rv; count = PR_MIN(count, aCount); - buffer = (char*)nsAllocator::Alloc(count+1); // make room for '\0' + buffer = (char*)nsMemory::Alloc(count+1); // make room for '\0' if (!buffer) return NS_ERROR_OUT_OF_MEMORY; PRUint32 amtRead = 0; rv = mInputStream->Read(buffer, count, &amtRead); if (NS_FAILED(rv)) { - nsAllocator::Free(buffer); + nsMemory::Free(buffer); return rv; } diff --git a/mozilla/xpcom/io/nsSegmentedBuffer.cpp b/mozilla/xpcom/io/nsSegmentedBuffer.cpp index f9684d67402..d9d0f03e58d 100644 --- a/mozilla/xpcom/io/nsSegmentedBuffer.cpp +++ b/mozilla/xpcom/io/nsSegmentedBuffer.cpp @@ -39,7 +39,7 @@ nsSegmentedBuffer::~nsSegmentedBuffer() nsresult nsSegmentedBuffer::Init(PRUint32 segmentSize, PRUint32 maxSize, - nsIAllocator* allocator) + nsIMemory* allocator) { if (mSegmentArrayCount != 0) return NS_ERROR_FAILURE; // initialized more than once @@ -47,7 +47,7 @@ nsSegmentedBuffer::Init(PRUint32 segmentSize, PRUint32 maxSize, mMaxSize = maxSize; mSegAllocator = allocator; if (mSegAllocator == nsnull) { - mSegAllocator = nsAllocator::GetGlobalAllocator(); + mSegAllocator = nsMemory::GetGlobalMemoryService(); } else { NS_ADDREF(mSegAllocator); @@ -68,7 +68,7 @@ nsSegmentedBuffer::AppendNewSegment() if (mSegmentArray == nsnull) { PRUint32 bytes = mSegmentArrayCount * sizeof(char*); - mSegmentArray = (char**)nsAllocator::Alloc(bytes); + mSegmentArray = (char**)nsMemory::Alloc(bytes); if (mSegmentArray == nsnull) return nsnull; nsCRT::memset(mSegmentArray, 0, bytes); @@ -77,7 +77,7 @@ nsSegmentedBuffer::AppendNewSegment() if (IsFull()) { PRUint32 newArraySize = mSegmentArrayCount * 2; PRUint32 bytes = newArraySize * sizeof(char*); - char** newSegArray = (char**)nsAllocator::Realloc(mSegmentArray, bytes); + char** newSegArray = (char**)nsMemory::Realloc(mSegmentArray, bytes); if (newSegArray == nsnull) return nsnull; mSegmentArray = newSegArray; @@ -159,7 +159,7 @@ nsSegmentedBuffer::Empty() if (mSegmentArray[i]) mSegAllocator->Free(mSegmentArray[i]); } - nsAllocator::Free(mSegmentArray); + nsMemory::Free(mSegmentArray); mSegmentArray = nsnull; } mSegmentArrayCount = NS_SEGMENTARRAY_INITIAL_COUNT; diff --git a/mozilla/xpcom/io/nsSegmentedBuffer.h b/mozilla/xpcom/io/nsSegmentedBuffer.h index 3892bacd674..11d14f0ef18 100644 --- a/mozilla/xpcom/io/nsSegmentedBuffer.h +++ b/mozilla/xpcom/io/nsSegmentedBuffer.h @@ -23,7 +23,7 @@ #ifndef nsSegmentedBuffer_h__ #define nsSegmentedBuffer_h__ -#include "nsIAllocator.h" +#include "nsMemory.h" #include "prclist.h" class nsSegmentedBuffer @@ -33,7 +33,7 @@ public: ~nsSegmentedBuffer(); nsresult Init(PRUint32 segmentSize, PRUint32 maxSize, - nsIAllocator* allocator = nsnull); + nsIMemory* allocator = nsnull); char* AppendNewSegment(); // pushes at end @@ -82,7 +82,7 @@ protected: protected: PRUint32 mSegmentSize; PRUint32 mMaxSize; - nsIAllocator* mSegAllocator; + nsIMemory* mSegAllocator; char** mSegmentArray; PRUint32 mSegmentArrayCount; PRInt32 mFirstSegmentIndex; diff --git a/mozilla/xpcom/io/nsStorageStream.cpp b/mozilla/xpcom/io/nsStorageStream.cpp index 9390771bf52..baa250550be 100644 --- a/mozilla/xpcom/io/nsStorageStream.cpp +++ b/mozilla/xpcom/io/nsStorageStream.cpp @@ -84,7 +84,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(nsStorageStream, NS_IMETHODIMP nsStorageStream::Init(PRUint32 segmentSize, PRUint32 maxSize, - nsIAllocator *segmentAllocator) + nsIMemory *segmentAllocator) { mSegmentedBuffer = new nsSegmentedBuffer(); if (!mSegmentedBuffer) diff --git a/mozilla/xpcom/io/nsStorageStream.h b/mozilla/xpcom/io/nsStorageStream.h index a9c7fb3f698..a3d6d4f4d83 100644 --- a/mozilla/xpcom/io/nsStorageStream.h +++ b/mozilla/xpcom/io/nsStorageStream.h @@ -32,6 +32,7 @@ #include "nsIStorageStream.h" #include "nsIOutputStream.h" +#include "nsMemory.h" class nsSegmentedBuffer; @@ -42,7 +43,7 @@ public: nsStorageStream(); virtual ~nsStorageStream(); - NS_METHOD Init(PRUint32 segmentSize, PRUint32 maxSize, nsIAllocator *segmentAllocator = 0); + NS_METHOD Init(PRUint32 segmentSize, PRUint32 maxSize, nsIMemory *segmentAllocator = 0); NS_DECL_ISUPPORTS NS_DECL_NSISTORAGESTREAM diff --git a/mozilla/xpcom/proxy/public/nsIProxyCreateInstance.idl b/mozilla/xpcom/proxy/public/nsIProxyCreateInstance.idl index 447c805c4a7..07033da95b9 100644 --- a/mozilla/xpcom/proxy/public/nsIProxyCreateInstance.idl +++ b/mozilla/xpcom/proxy/public/nsIProxyCreateInstance.idl @@ -1,3 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + #include "nsISupports.idl" /* XXX should be built in */ @@ -10,11 +32,11 @@ interface nsIProxyCreateInstance : nsISupports [noscript] void CreateInstanceByIID(in nsIIDRef cid, in nsISupports aOuter, in nsIIDRef iid, - out voidStar result); + out voidPtr result); [noscript] void CreateInstanceByProgID(in string aProgID, in nsISupports aOuter, in nsIIDRef iid, - out voidStar result); + out voidPtr result); }; diff --git a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp index e4617e5c3b3..ba828407748 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp @@ -43,7 +43,7 @@ #include "nsRepository.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIEventQueueService.h" #include "nsIThread.h" @@ -582,7 +582,7 @@ AutoProxyParameterList(PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTC if( !currentType.IsPointer() || currentType.TagPart() != nsXPTType::T_IID || - !(iid = (nsIID*) nsAllocator::Clone(params[arg_num].val.p, sizeof(nsIID)))) + !(iid = (nsIID*) nsMemory::Clone(params[arg_num].val.p, sizeof(nsIID)))) { // This is really bad that we are here. rv = NS_ERROR_PROXY_INVALID_IN_PARAMETER; @@ -607,7 +607,7 @@ AutoProxyParameterList(PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTC printf(" could not find an IID for a parameter: %d\n", (i) ); printf("**************************************************\n"); - nsAllocator::Free((void*)interfaceName); + nsMemory::Free((void*)interfaceName); #endif /* DEBUG */ @@ -657,7 +657,7 @@ AutoProxyParameterList(PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTC if (NS_SUCCEEDED( rv ) && iid && iid->Equals(NS_GET_IID(nsIAtom))) { - nsAllocator::Free((void*)iid); + nsMemory::Free((void*)iid); NS_RELEASE(manager); NS_RELEASE(eventQ); continue; @@ -676,7 +676,7 @@ AutoProxyParameterList(PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTC NS_RELEASE(eventQ); } - nsAllocator::Free((void*)iid); + nsMemory::Free((void*)iid); NS_RELEASE(manager); if (NS_FAILED(rv)) diff --git a/mozilla/xpcom/proxy/src/nsProxyEventClass.cpp b/mozilla/xpcom/proxy/src/nsProxyEventClass.cpp index 1049dc05ad0..9c78ea23e70 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEventClass.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEventClass.cpp @@ -30,7 +30,7 @@ #include "nsIServiceManager.h" #include "nsCOMPtr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsHashtable.h" #include "nsAutoLock.h" @@ -118,7 +118,7 @@ nsProxyEventClass::GetNewOrUsedClass(REFNSIID aIID) if(NS_SUCCEEDED(oldest->GetIID(&iid))) { isISupportsDescendent = iid->Equals(NS_GET_IID(nsISupports)); - nsAllocator::Free(iid); + nsMemory::Free(iid); } NS_VERIFY(isISupportsDescendent,"!isISupportsDescendent"); @@ -334,7 +334,7 @@ nsProxyEventClass::DelegatedQueryInterface(nsProxyEventObject* self, if(NS_SUCCEEDED(current->GetIID(&iid)) && iid) { PRBool found = aIID.Equals(*iid); - nsAllocator::Free(iid); + nsMemory::Free(iid); if(found) { *aInstancePtr = (void*) self; diff --git a/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp b/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp index 36bc08a8d85..bc46ce7a0c1 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp @@ -80,7 +80,7 @@ nsProxyEventObject::DebugDump(const char * message, PRUint32 hashKey) GetClass()->GetInterfaceInfo()->GetName(&name); printf("interface name is %s\n", name); if(name) - nsAllocator::Free(name); + nsMemory::Free(name); char * iid = GetClass()->GetProxiedIID().ToString(); printf("IID number is %s\n", iid); delete iid; diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp index 8d7691db01e..08a166bf390 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp @@ -216,7 +216,7 @@ xptiInterfaceInfo::GetName(char **name) if(!mName) return NS_ERROR_UNEXPECTED; - char* ptr = *name = (char*) nsAllocator::Clone(mName, PL_strlen(mName)+1); + char* ptr = *name = (char*) nsMemory::Clone(mName, PL_strlen(mName)+1); return ptr ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -225,7 +225,7 @@ xptiInterfaceInfo::GetIID(nsIID **iid) { NS_PRECONDITION(iid, "bad param"); - nsIID* ptr = *iid = (nsIID*) nsAllocator::Clone(&mIID, sizeof(nsIID)); + nsIID* ptr = *iid = (nsIID*) nsMemory::Clone(&mIID, sizeof(nsIID)); return ptr ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index 250e979edf9..f8d0858fcd6 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -216,13 +216,13 @@ xptiInterfaceInfoManager::BuildFileList(nsISupportsArray** aFileList) if(xptiFileType::IsUnknown(name)) { - nsAllocator::Free(name); + nsMemory::Free(name); continue; } LOG_AUTOREG(("found file: %s\n", name)); - nsAllocator::Free(name); + nsMemory::Free(name); if(!fileList->InsertElementAt(file, count)) return PR_FALSE; @@ -430,8 +430,8 @@ xptiSortFileList(const void * p1, const void *p2, void * closure) PRBool isXPT2 = xptiFileType::IsXPT(name2); int nameOrder = PL_strcmp(name1, name2); - nsAllocator::Free(name1); - nsAllocator::Free(name2); + nsMemory::Free(name1); + nsMemory::Free(name2); // XXX need to test with non-empty working sets to be sure this right @@ -590,7 +590,7 @@ xptiInterfaceInfoManager::DetermineAutoRegStrategy(nsISupportsArray* aFileList, if(k == countOfFilesInWorkingSet) same = PR_FALSE; } - nsAllocator::Free(name); + nsMemory::Free(name); } if(same) return NO_FILES_CHANGED; @@ -626,7 +626,7 @@ xptiInterfaceInfoManager::DetermineAutoRegStrategy(nsISupportsArray* aFileList, } PRBool sameName = (0 == PL_strcasecmp(name, target.GetName())); - nsAllocator::Free(name); + nsMemory::Free(name); if(sameName) { if(nsInt64(size) != target.GetSize() || @@ -695,7 +695,7 @@ xptiInterfaceInfoManager::AddOnlyNewFileFromFileList(nsISupportsArray* aFileList if(xptiWorkingSet::NOT_FOUND != aWorkingSet->FindFileWithName(name)) { // This file was found in the working set, so skip it. - nsAllocator::Free(name); + nsMemory::Free(name); continue; } @@ -704,7 +704,7 @@ xptiInterfaceInfoManager::AddOnlyNewFileFromFileList(nsISupportsArray* aFileList xptiFile fileRecord; fileRecord = xptiFile(nsInt64(size), nsInt64(date), name, aWorkingSet); - nsAllocator::Free(name); + nsMemory::Free(name); if(xptiFileType::IsXPT(fileRecord.GetName())) { @@ -827,7 +827,7 @@ xptiInterfaceInfoManager::DoFullValidationMergeFromFileList(nsISupportsArray* aF xptiFile fileRecord; fileRecord = xptiFile(nsInt64(size), nsInt64(date), name, aWorkingSet); - nsAllocator::Free(name); + nsMemory::Free(name); // printf("* found %s\n", fileRecord.GetName()); @@ -1223,7 +1223,7 @@ xptiInterfaceInfoManager::DEBUG_DumpFileList(nsISupportsArray* aFileList) return PR_FALSE; printf("* found %s\n", name); - nsAllocator::Free(name); + nsMemory::Free(name); } return PR_TRUE; } @@ -1254,7 +1254,7 @@ xptiInterfaceInfoManager::DEBUG_DumpFileArray(nsILocalFile** aFileArray, return PR_FALSE; printf("found file: %s\n", name); - nsAllocator::Free(name); + nsMemory::Free(name); } return PR_TRUE; } diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiZipLoader.cpp b/mozilla/xpcom/reflect/xptinfo/src/xptiZipLoader.cpp index c15389ca0b7..865deee285e 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiZipLoader.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiZipLoader.cpp @@ -87,7 +87,7 @@ xptiZipLoader::EnumerateZipEntries(nsILocalFile* file, if(header) result = sink->FoundEntry(itemName, index++, header, aWorkingSet); - nsAllocator::Free(itemName); + nsMemory::Free(itemName); if(!header) return PR_FALSE; diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h index 8dc93766ae4..3ef7a018ce9 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -43,7 +43,7 @@ #include "nsIDirectoryService.h" #include "nsCRT.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsISupportsArray.h" #include "nsInt64.h" diff --git a/mozilla/xpcom/sample/nsSample.cpp b/mozilla/xpcom/sample/nsSample.cpp index ec65e97d57e..9a073ceed50 100644 --- a/mozilla/xpcom/sample/nsSample.cpp +++ b/mozilla/xpcom/sample/nsSample.cpp @@ -32,7 +32,7 @@ #include "stdio.h" #include "nsSample.h" -#include "nsIAllocator.h" +#include "nsMemory.h" //////////////////////////////////////////////////////////////////////// @@ -82,12 +82,12 @@ nsSampleImpl::GetValue(char** aValue) * On the other hand, if we create a new copy of the data for our * client, and it turns out that client is implemented in JavaScript, * there would be no way to free the buffer. The solution to the - * buffer ownership problem is the nsAllocator singleton. Any buffer - * returned by an XPCOM method should be allocated by the nsAllocator. + * buffer ownership problem is the nsMemory singleton. Any buffer + * returned by an XPCOM method should be allocated by the nsMemory. * This convention lets things like JavaScript reflection do their * job, and simplifies the way C++ clients deal with returned buffers. */ - *aValue = (char*) nsAllocator::Alloc(PL_strlen(mValue) + 1); + *aValue = (char*) nsMemory::Alloc(PL_strlen(mValue) + 1); if (! *aValue) return NS_ERROR_NULL_POINTER; diff --git a/mozilla/xpcom/string/obsolete/nsStr.cpp b/mozilla/xpcom/string/obsolete/nsStr.cpp index 906267b01f8..823aa3e95a2 100644 --- a/mozilla/xpcom/string/obsolete/nsStr.cpp +++ b/mozilla/xpcom/string/obsolete/nsStr.cpp @@ -664,7 +664,7 @@ PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) { aDest.mCapacity=theNewCapacity++; PRUint32 theSize=(theNewCapacity< #include #include "plhash.h" @@ -493,8 +493,8 @@ inline void AddNullTerminator(nsStr& aDest) { * Return the given buffer to the heap manager. Calls allocator::Free() * @return string length */ -inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); } -inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); } +inline void Recycle( char* aBuffer) { nsMemory::Free(aBuffer); } +inline void Recycle( PRUnichar* aBuffer) { nsMemory::Free(aBuffer); } /** * This method is used to access a given char in the given string diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index 38f5624e0de..07e82de4e98 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -662,7 +662,7 @@ char* nsCString::ToNewCString() const { * @return ptr to new ascii string */ PRUnichar* nsCString::ToNewUnicode() const { - PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsAllocator::Alloc(sizeof(PRUnichar) * (mLength + 1))); + PRUnichar* result = NS_STATIC_CAST(PRUnichar*, nsMemory::Alloc(sizeof(PRUnichar) * (mLength + 1))); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsAutoString temp(desc); diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index af9d4aff01f..05b32a47dda 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -719,7 +719,7 @@ nsString* nsString::ToNewString() const { * @return ptr to new ascii string */ char* nsString::ToNewCString() const { - char* result = NS_STATIC_CAST(char*, nsAllocator::Alloc(mLength + 1)); + char* result = NS_STATIC_CAST(char*, nsMemory::Alloc(mLength + 1)); if (result) { CBufDescriptor desc(result, PR_TRUE, mLength + 1, 0); nsCAutoString temp(desc); diff --git a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp index 4e23edce83d..1ef8e962683 100644 --- a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp @@ -21,14 +21,14 @@ */ #include "nsDebug.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsXPIDLString.h" #include "plstr.h" // If the allocator changes, fix it here. -#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar))) -#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char))) -#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr)) +#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsMemory::Alloc((__len) * sizeof(PRUnichar))) +#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsMemory::Alloc((__len) * sizeof(char))) +#define XPIDL_FREE(__ptr) (nsMemory::Free(__ptr)) //////////////////////////////////////////////////////////////////////// // nsXPIDLString diff --git a/mozilla/xpcom/string/obsolete/nsXPIDLString.h b/mozilla/xpcom/string/obsolete/nsXPIDLString.h index 3ac35b130e8..3cd75524e17 100644 --- a/mozilla/xpcom/string/obsolete/nsXPIDLString.h +++ b/mozilla/xpcom/string/obsolete/nsXPIDLString.h @@ -48,7 +48,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - nsAllocator::Free(bar); + nsMemory::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -62,7 +62,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to nsAllocator::Free(). + // no need to remember to nsMemory::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an diff --git a/mozilla/xpcom/tests/nsIFileTest.cpp b/mozilla/xpcom/tests/nsIFileTest.cpp index 158f19449f2..a36a79e1b4e 100644 --- a/mozilla/xpcom/tests/nsIFileTest.cpp +++ b/mozilla/xpcom/tests/nsIFileTest.cpp @@ -3,7 +3,7 @@ #include "stdio.h" #include "nsIComponentManager.h" #include "nsIServiceManager.h" -#include "nsIAllocator.h" +#include "nsIMemory.h" #include "nsXPIDLString.h" void Passed(); diff --git a/mozilla/xpcom/tools/registry/regExport.cpp b/mozilla/xpcom/tools/registry/regExport.cpp index 6ab37f24a2a..0fe79085dbf 100644 --- a/mozilla/xpcom/tools/registry/regExport.cpp +++ b/mozilla/xpcom/tools/registry/regExport.cpp @@ -29,7 +29,7 @@ #include "nsIEnumerator.h" #include "prmem.h" #include "plstr.h" -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsIFileSpec.h" static void display( nsIRegistry *reg, nsRegistryKey root, const char *name ); @@ -254,7 +254,7 @@ static void displayValues( nsIRegistry *reg, nsRegistryKey root ) { rv = reg->GetStringUTF8( root, name, &strValue ); if ( rv == NS_OK ) { printString( strValue, strlen(name) ); - nsAllocator::Free( strValue ); + nsMemory::Free( strValue ); } else { printf( "\t Error getting string value, rv=0x%08X", (int)rv ); } @@ -290,7 +290,7 @@ static void displayValues( nsIRegistry *reg, nsRegistryKey root ) { printf( "\t= ? (error getting value, rv=0x%08X)", (int)rv ); } printf("\n"); - nsAllocator::Free( name ); + nsMemory::Free( name ); } else { printf( "Error getting value name, rv=0x%08X\n", (int)rv ); } diff --git a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp index e2319a2e605..13ce09e5182 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp @@ -241,7 +241,7 @@ nsCmdLineService::~nsCmdLineService() while ( curr ) { char* str = NS_REINTERPRET_CAST(char*, mArgList[curr-1]); if ( str ) - nsAllocator::Free(str); + nsMemory::Free(str); --curr; } @@ -249,7 +249,7 @@ nsCmdLineService::~nsCmdLineService() while ( curr ) { char* str = NS_REINTERPRET_CAST(char*, mArgValueList[curr-1]); if ( str ) - nsAllocator::Free(str); + nsMemory::Free(str); --curr; } } diff --git a/mozilla/xpfe/appshell/src/nsUserInfoMac.cpp b/mozilla/xpfe/appshell/src/nsUserInfoMac.cpp index ba891773d28..a9adba04b8d 100644 --- a/mozilla/xpfe/appshell/src/nsUserInfoMac.cpp +++ b/mozilla/xpfe/appshell/src/nsUserInfoMac.cpp @@ -45,7 +45,7 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) { nsString fullName; fullName.AssignWithConversion( cName ); - nsAllocator::Free( cName ); + nsMemory::Free( cName ); *aFullname = fullName.ToNewUnicode(); } return result; @@ -69,7 +69,7 @@ nsUserInfo::GetUsername(char * *aUsername) if ( NS_FAILED( rv ) ) return rv; nsCAutoString tempString(cString); - nsAllocator::Free( cString ); + nsMemory::Free( cString ); const char* atString = "@"; PRInt32 atOffset = tempString.Find(atString); if (atOffset != kNotFound) @@ -88,7 +88,7 @@ nsUserInfo::GetDomain(char * *aDomain) nsresult rv = ic.GetString( kICEmail, &cString ); if ( NS_FAILED( rv ) ) return rv; nsCAutoString tempString( cString); - nsAllocator::Free( cString ); + nsMemory::Free( cString ); const char* atString = "@"; PRInt32 atOffset = tempString.Find(atString); if (atOffset != kNotFound) diff --git a/mozilla/xpfe/bootstrap/appleevents/nsAEGetURLSuiteHandler.cpp b/mozilla/xpfe/bootstrap/appleevents/nsAEGetURLSuiteHandler.cpp index 53ebe742250..526a84e80ae 100644 --- a/mozilla/xpfe/bootstrap/appleevents/nsAEGetURLSuiteHandler.cpp +++ b/mozilla/xpfe/bootstrap/appleevents/nsAEGetURLSuiteHandler.cpp @@ -22,7 +22,7 @@ */ -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsAEGetURLSuiteHandler.h" #include "nsCommandLineServiceMac.h" @@ -108,7 +108,7 @@ void AEGetURLSuiteHandler::HandleGetURLEvent(AppleEvent *appleEvent, AppleEvent // we need to look for other parameters, to do with destination etc. long dataSize = directParameter.GetDataSize(); - char* urlString = (char *)nsAllocator::Alloc(dataSize + 1); + char* urlString = (char *)nsMemory::Alloc(dataSize + 1); ThrowIfNil(urlString); directParameter.GetCString(urlString, dataSize); @@ -116,6 +116,6 @@ void AEGetURLSuiteHandler::HandleGetURLEvent(AppleEvent *appleEvent, AppleEvent nsMacCommandLine& cmdLine = nsMacCommandLine::GetMacCommandLine(); cmdLine.DispatchURLToNewBrowser(urlString); - nsAllocator::Free(urlString); + nsMemory::Free(urlString); } diff --git a/mozilla/xpfe/bootstrap/appleevents/nsAESpyglassSuiteHandler.cpp b/mozilla/xpfe/bootstrap/appleevents/nsAESpyglassSuiteHandler.cpp index 5463def3abb..4004c61da8d 100644 --- a/mozilla/xpfe/bootstrap/appleevents/nsAESpyglassSuiteHandler.cpp +++ b/mozilla/xpfe/bootstrap/appleevents/nsAESpyglassSuiteHandler.cpp @@ -22,7 +22,7 @@ */ -#include "nsIAllocator.h" +#include "nsMemory.h" #include "nsAESpyglassSuiteHandler.h" #include "nsCommandLineServiceMac.h" @@ -108,7 +108,7 @@ void AESpyglassSuiteHandler::HandleOpenURLEvent(AppleEvent *appleEvent, AppleEve long dataSize = directParameter.GetDataSize(); - char* urlString = (char *)nsAllocator::Alloc(dataSize + 1); + char* urlString = (char *)nsMemory::Alloc(dataSize + 1); ThrowIfNil(urlString); directParameter.GetCString(urlString, dataSize); @@ -116,7 +116,7 @@ void AESpyglassSuiteHandler::HandleOpenURLEvent(AppleEvent *appleEvent, AppleEve nsMacCommandLine& cmdLine = nsMacCommandLine::GetMacCommandLine(); cmdLine.DispatchURLToNewBrowser(urlString); - nsAllocator::Free(urlString); + nsMemory::Free(urlString); } diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index 96f193209bc..8e02d51b03a 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -2062,7 +2062,7 @@ NS_IMETHODIMP nsBrowserContentHandler::GetDefaultArgs(PRUnichar **aDefaultArgs) if ( NS_FAILED(rv) ) return rv; *aDefaultArgs = NS_ConvertASCIItoUCS2(url).ToNewUnicode(); - nsAllocator::Free(urlString); + nsMemory::Free(urlString); return rv; } } diff --git a/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp b/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp index ac773e46c41..dfb9c754c61 100644 --- a/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp +++ b/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp @@ -945,7 +945,7 @@ nsGlobalHistory::GetSources(nsIRDFResource* aProperty, if (NS_FAILED(rv)) return rv; len = PL_strlen(buf); - value = nsAllocator::Alloc(len + 1); + value = nsMemory::Alloc(len + 1); if (! value) return NS_ERROR_OUT_OF_MEMORY; @@ -1798,7 +1798,7 @@ nsGlobalHistory::NotifyChange(nsIRDFResource* aSource, nsGlobalHistory::URLEnumerator::~URLEnumerator() { - nsAllocator::Free(mSelectValue); + nsMemory::Free(mSelectValue); } PRBool diff --git a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp index e2319a2e605..13ce09e5182 100644 --- a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp @@ -241,7 +241,7 @@ nsCmdLineService::~nsCmdLineService() while ( curr ) { char* str = NS_REINTERPRET_CAST(char*, mArgList[curr-1]); if ( str ) - nsAllocator::Free(str); + nsMemory::Free(str); --curr; } @@ -249,7 +249,7 @@ nsCmdLineService::~nsCmdLineService() while ( curr ) { char* str = NS_REINTERPRET_CAST(char*, mArgValueList[curr-1]); if ( str ) - nsAllocator::Free(str); + nsMemory::Free(str); --curr; } } diff --git a/mozilla/xpfe/components/startup/src/nsUserInfoMac.cpp b/mozilla/xpfe/components/startup/src/nsUserInfoMac.cpp index ba891773d28..a9adba04b8d 100644 --- a/mozilla/xpfe/components/startup/src/nsUserInfoMac.cpp +++ b/mozilla/xpfe/components/startup/src/nsUserInfoMac.cpp @@ -45,7 +45,7 @@ nsUserInfo::GetFullname(PRUnichar **aFullname) { nsString fullName; fullName.AssignWithConversion( cName ); - nsAllocator::Free( cName ); + nsMemory::Free( cName ); *aFullname = fullName.ToNewUnicode(); } return result; @@ -69,7 +69,7 @@ nsUserInfo::GetUsername(char * *aUsername) if ( NS_FAILED( rv ) ) return rv; nsCAutoString tempString(cString); - nsAllocator::Free( cString ); + nsMemory::Free( cString ); const char* atString = "@"; PRInt32 atOffset = tempString.Find(atString); if (atOffset != kNotFound) @@ -88,7 +88,7 @@ nsUserInfo::GetDomain(char * *aDomain) nsresult rv = ic.GetString( kICEmail, &cString ); if ( NS_FAILED( rv ) ) return rv; nsCAutoString tempString( cString); - nsAllocator::Free( cString ); + nsMemory::Free( cString ); const char* atString = "@"; PRInt32 atOffset = tempString.Find(atString); if (atOffset != kNotFound) diff --git a/mozilla/xpfe/components/timebomb/nsTimeBomb.cpp b/mozilla/xpfe/components/timebomb/nsTimeBomb.cpp index 2614977c84b..2efb7fc77f2 100644 --- a/mozilla/xpfe/components/timebomb/nsTimeBomb.cpp +++ b/mozilla/xpfe/components/timebomb/nsTimeBomb.cpp @@ -177,7 +177,7 @@ nsTimeBomb::LoadUpdateURL() nsresult rv = GetTimebombURL(&url); if (NS_FAILED(rv)) return rv; rv = DisplayURI(url, PR_FALSE); - nsAllocator::Free(url); + nsMemory::Free(url); return rv; } @@ -358,7 +358,7 @@ nsTimeBomb::GetTimebombURL(char* *url) nsresult rv = mPrefs->CopyCharPref("timebomb.timebombURL", &string); if (NS_SUCCEEDED(rv)) { - *url = (char*)nsAllocator::Clone(string, (strlen(string)+1)*sizeof(char)); + *url = (char*)nsMemory::Clone(string, (strlen(string)+1)*sizeof(char)); PL_strfree(string); @@ -368,7 +368,7 @@ nsTimeBomb::GetTimebombURL(char* *url) } string = "http://www.mozilla.org/projects/seamonkey/"; - *url = (char*)nsAllocator::Clone(string, (strlen(string)+1)*sizeof(char)); + *url = (char*)nsMemory::Clone(string, (strlen(string)+1)*sizeof(char)); if(!*url) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/xpinstall/notifier/nsXPIFlash.cpp b/mozilla/xpinstall/notifier/nsXPIFlash.cpp index 3a779aba659..676b7244b10 100644 --- a/mozilla/xpinstall/notifier/nsXPIFlash.cpp +++ b/mozilla/xpinstall/notifier/nsXPIFlash.cpp @@ -298,7 +298,7 @@ nsXPINotifierImpl::Init() aDistributor->GetValue(&uri); rv = OpenRemoteDataSource(uri, PR_FALSE, getter_AddRefs(remoteDatasource)); - nsAllocator::Free(uri); + nsMemory::Free(uri); if (NS_FAILED(rv)) break; distributorEnumerator->HasMoreElements(&moreElements); @@ -589,8 +589,8 @@ nsXPINotifierImpl::OnEndLoad(nsIRDFXMLSink *aSink) PRUnichar* versionCString; version->GetValue(&versionCString); nsString versionString(versionCString); - nsAllocator::Free(versionCString); - nsAllocator::Free(regkeyCString); + nsMemory::Free(versionCString); + nsMemory::Free(regkeyCString); // check to see if this software title should be "flashed" if (IsNewerOrUninstalled(nsAutoCString(regKeyString), nsAutoCString(versionString))) diff --git a/mozilla/xpinstall/src/nsInstallFile.cpp b/mozilla/xpinstall/src/nsInstallFile.cpp index 3167d5fd382..6b252ca9c40 100644 --- a/mozilla/xpinstall/src/nsInstallFile.cpp +++ b/mozilla/xpinstall/src/nsInstallFile.cpp @@ -291,7 +291,7 @@ void nsInstallFile::CreateAllFolders(nsInstall *inInstall, nsIFile *inFolderPath inFolderPath->GetPath(&szPath); nsStrFolder.AssignWithConversion(szPath); - nsAllocator::Free(szPath); + nsMemory::Free(szPath); ilc = new nsInstallLogComment(inInstall, NS_ConvertASCIItoUCS2("CreateFolder"), nsStrFolder, error); if(ilc == nsnull) *error = nsInstall::OUT_OF_MEMORY; diff --git a/mozilla/xpinstall/src/nsInstallFileOpItem.cpp b/mozilla/xpinstall/src/nsInstallFileOpItem.cpp index bcb2414922d..09ea7123f13 100644 --- a/mozilla/xpinstall/src/nsInstallFileOpItem.cpp +++ b/mozilla/xpinstall/src/nsInstallFileOpItem.cpp @@ -1263,14 +1263,14 @@ nsInstallFileOpItem::NativeFileOpMacAliasComplete() if (err != noErr) { if (aliasLeaf) - nsAllocator::Free(aliasLeaf); + nsMemory::Free(aliasLeaf); return err; } c2pstr(aliasLeaf); FSMakeFSSpec(fsAliasParent.vRefNum, aliasDirID, (unsigned char *) aliasLeaf, &fsAlias); p2cstr((unsigned char *)aliasLeaf); if (aliasLeaf) - nsAllocator::Free(aliasLeaf); + nsMemory::Free(aliasLeaf); err = NewAliasMinimal( &fsSource, &aliasH ); if (err != noErr) // bubble up Alias Manager error diff --git a/mozilla/xpinstall/src/nsInstallTrigger.cpp b/mozilla/xpinstall/src/nsInstallTrigger.cpp index 977afd06a10..ef0fd5fdfc9 100644 --- a/mozilla/xpinstall/src/nsInstallTrigger.cpp +++ b/mozilla/xpinstall/src/nsInstallTrigger.cpp @@ -128,7 +128,7 @@ nsInstallTrigger::HandleContent(const char * aContentType, PRBool value; rv = StartSoftwareUpdate(NS_ConvertASCIItoUCS2(spec), 0, &value); - nsAllocator::Free(spec); + nsMemory::Free(spec); if (NS_SUCCEEDED(rv) && value) return NS_OK; diff --git a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp index 516d81a29d3..c16886653b1 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp @@ -150,7 +150,7 @@ nsSoftwareUpdate::nsSoftwareUpdate() // EVIL version registry does not take a nsIFile.; VR_SetRegDirectory( nativePath ); if (nativePath) - nsAllocator::Free(nativePath); + nsMemory::Free(nativePath); } } diff --git a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp index 789a4aced1c..b57a454205a 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -107,7 +107,7 @@ XPInstallErrorReporter(JSContext *cx, const char *message, JSErrorReport *report rv = errorObject->Init(report->ucmessage, newFileUni, report->uclinebuf, report->lineno, column, report->flags, "XPInstall JavaScript"); - nsAllocator::Free((void *)newFileUni); + nsMemory::Free((void *)newFileUni); if (NS_SUCCEEDED(rv)) { rv = consoleService->LogMessage(errorObject); if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/xpinstall/src/nsUpdateNotification.cpp b/mozilla/xpinstall/src/nsUpdateNotification.cpp index 0552ff21727..ed95e590da2 100644 --- a/mozilla/xpinstall/src/nsUpdateNotification.cpp +++ b/mozilla/xpinstall/src/nsUpdateNotification.cpp @@ -256,7 +256,7 @@ nsXPINotifierImpl::Init() aDistributor->GetValue(&uri); rv = OpenRemoteDataSource(uri, PR_FALSE, getter_AddRefs(remoteDatasource)); - nsAllocator::Free(uri); + nsMemory::Free(uri); if (NS_FAILED(rv)) break; distributorEnumerator->HasMoreElements(&moreElements); @@ -547,8 +547,8 @@ nsXPINotifierImpl::OnEndLoad(nsIRDFXMLSink *aSink) PRUnichar* versionCString; version->GetValue(&versionCString); nsString versionString(versionCString); - nsAllocator::Free(versionCString); - nsAllocator::Free(regkeyCString); + nsMemory::Free(versionCString); + nsMemory::Free(regkeyCString); // check to see if this software title should be "flashed" if (IsNewerOrUninstalled(nsAutoCString(regKeyString), nsAutoCString(versionString)))