20 nsCOMPtr_optimized 112
22 raw_optimized 124 bytes
23 (1.1071) i.e., 10.71% bigger than nsCOMPtr_optimized nsCOMPtr
28 Test03_raw(nsINode
* aDOMNode
, nsString
* aResult
)
31 // -- the following code is assumed, but is commented out so we compare only
32 // the relevent generated code
34 // if ( !aDOMNode || !aResult )
35 // return NS_ERROR_NULL_POINTER;
38 nsresult status
= aDOMNode
->GetParentNode(&parent
);
40 if (NS_SUCCEEDED(status
)) {
41 parent
->GetNodeName(*aResult
);
44 NS_IF_RELEASE(parent
);
50 Test03_raw_optimized(nsINode
* aDOMNode
, nsString
* aResult
)
53 // if ( !aDOMNode || !aResult )
54 // return NS_ERROR_NULL_POINTER;
57 nsresult status
= aDOMNode
->GetParentNode(&parent
);
59 if (NS_SUCCEEDED(status
)) {
60 parent
->GetNodeName(*aResult
);
68 Test03_nsCOMPtr(nsINode
* aDOMNode
, nsString
* aResult
)
71 // if ( !aDOMNode || !aResult )
72 // return NS_ERROR_NULL_POINTER;
74 nsCOMPtr
<nsINode
> parent
;
75 nsresult status
= aDOMNode
->GetParentNode(getter_AddRefs(parent
));
76 if (parent
) parent
->GetNodeName(*aResult
);
82 Test03_nsCOMPtr_optimized(nsINode
* aDOMNode
, nsString
* aResult
)
85 // if ( !aDOMNode || !aResult )
86 // return NS_ERROR_NULL_POINTER;
89 nsresult status
= aDOMNode
->GetParentNode(&temp
);
90 nsCOMPtr
<nsINode
> parent(dont_AddRef(temp
));
91 if (parent
) parent
->GetNodeName(*aResult
);