1999-05-11 00:46:31 +04:00
|
|
|
// Test04.cpp
|
|
|
|
|
2018-05-30 05:58:49 +03:00
|
|
|
#include "nsINode.h"
|
1999-05-11 00:46:31 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2018-05-30 05:58:49 +03:00
|
|
|
NS_DEF_PTR(nsINode);
|
1999-05-11 00:46:31 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
Windows:
|
|
|
|
nsCOMPtr 13 raw
|
|
|
|
36
|
2018-12-14 21:10:35 +03:00
|
|
|
|
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
|
|
|
|
*/
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
class Test04_Raw {
|
|
|
|
public:
|
|
|
|
Test04_Raw();
|
|
|
|
~Test04_Raw();
|
2018-12-14 21:10:35 +03:00
|
|
|
|
2018-05-30 05:58:49 +03:00
|
|
|
void /*nsresult*/ SetNode(nsINode* newNode);
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
private:
|
2018-05-30 05:58:49 +03:00
|
|
|
nsINode* mNode;
|
1999-05-11 00:46:31 +04:00
|
|
|
};
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
Test04_Raw::Test04_Raw() : mNode(0) {
|
|
|
|
// nothing else to do here
|
|
|
|
}
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
Test04_Raw::~Test04_Raw() { NS_IF_RELEASE(mNode); }
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
void // nsresult
|
2018-05-30 05:58:49 +03:00
|
|
|
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;
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
// return NS_OK;
|
|
|
|
}
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
class Test04_nsCOMPtr {
|
|
|
|
public:
|
2018-05-30 05:58:49 +03:00
|
|
|
void /*nsresult*/ SetNode(nsINode* newNode);
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
private:
|
2018-05-30 05:58:49 +03:00
|
|
|
nsCOMPtr<nsINode> mNode;
|
1999-05-11 00:46:31 +04:00
|
|
|
};
|
2018-12-14 21:10:35 +03:00
|
|
|
|
1999-05-11 00:46:31 +04:00
|
|
|
void // nsresult
|
2018-05-30 05:58:49 +03:00
|
|
|
Test04_nsCOMPtr::SetNode(nsINode* newNode)
|
1999-05-11 00:46:31 +04:00
|
|
|
// m36, w13/13
|
|
|
|
{
|
|
|
|
mNode = newNode;
|
|
|
|
}
|