Bug 548621 - Create suite of tests for JS parsing speed. r=jorendorff.
[mozilla-central.git] / xpcom / tests / SizeTest04.cpp
blobe045f29f6bbb2b7a7f40797cfe59afcc8a4f37c8
1 // Test04.cpp
3 #include "nsIDOMNode.h"
4 #include "nsCOMPtr.h"
6 NS_DEF_PTR(nsIDOMNode);
8 /*
9 Windows:
10 nsCOMPtr 13
11 raw 36
13 Macintosh:
14 nsCOMPtr 36 bytes (1.0000)
15 raw 120 (3.3333) i.e., 333.33% bigger than nsCOMPtr
18 class Test04_Raw
20 public:
21 Test04_Raw();
22 ~Test04_Raw();
24 void /*nsresult*/ SetNode( nsIDOMNode* newNode );
26 private:
27 nsIDOMNode* mNode;
30 Test04_Raw::Test04_Raw()
31 : mNode(0)
33 // nothing else to do here
36 Test04_Raw::~Test04_Raw()
38 NS_IF_RELEASE(mNode);
41 void // nsresult
42 Test04_Raw::SetNode( nsIDOMNode* newNode )
43 // m120, w36
45 NS_IF_ADDREF(newNode);
46 NS_IF_RELEASE(mNode);
47 mNode = newNode;
49 // return NS_OK;
54 class Test04_nsCOMPtr
56 public:
57 void /*nsresult*/ SetNode( nsIDOMNode* newNode );
59 private:
60 nsCOMPtr<nsIDOMNode> mNode;
63 void // nsresult
64 Test04_nsCOMPtr::SetNode( nsIDOMNode* newNode )
65 // m36, w13/13
67 mNode = newNode;