gecko-dev/xpcom/tests/SizeTest04.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 строки
921 B
C++
Исходник Обычный вид История

1999-05-11 00:46:31 +04:00
// Test04.cpp
#include "nsINode.h"
1999-05-11 00:46:31 +04:00
#include "nsCOMPtr.h"
NS_DEF_PTR(nsINode);
1999-05-11 00:46:31 +04:00
/*
Windows:
nsCOMPtr 13 raw
36
1999-05-11 00:46:31 +04:00
Macintosh:
nsCOMPtr
36 bytes (1.0000) raw
120 (3.3333) i.e., 333.33% bigger
than nsCOMPtr
*/
1999-05-11 00:46:31 +04:00
class Test04_Raw {
public:
Test04_Raw();
~Test04_Raw();
void /*nsresult*/ SetNode(nsINode* newNode);
1999-05-11 00:46:31 +04:00
private:
nsINode* mNode;
1999-05-11 00:46:31 +04:00
};
1999-05-11 00:46:31 +04:00
Test04_Raw::Test04_Raw() : mNode(0) {
// nothing else to do here
}
1999-05-11 00:46:31 +04:00
Test04_Raw::~Test04_Raw() { NS_IF_RELEASE(mNode); }
1999-05-11 00:46:31 +04:00
void // nsresult
Test04_Raw::SetNode(nsINode* newNode)
1999-05-11 00:46:31 +04:00
// m120, w36
{
NS_IF_ADDREF(newNode);
NS_IF_RELEASE(mNode);
mNode = newNode;
1999-05-11 00:46:31 +04:00
// return NS_OK;
}
1999-05-11 00:46:31 +04:00
class Test04_nsCOMPtr {
public:
void /*nsresult*/ SetNode(nsINode* newNode);
1999-05-11 00:46:31 +04:00
private:
nsCOMPtr<nsINode> mNode;
1999-05-11 00:46:31 +04:00
};
1999-05-11 00:46:31 +04:00
void // nsresult
Test04_nsCOMPtr::SetNode(nsINode* newNode)
1999-05-11 00:46:31 +04:00
// m36, w13/13
{
mNode = newNode;
}