Closed Bug 172131 Opened 22 years ago Closed 22 years ago

FMM, Comments which suggest the wrong (De)Allocator, and Style

Categories

(Core :: XPCOM, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

Details

Attachments

(1 file, 4 obsolete files)

nsCRT.h's comment suggests the wrong (De)Allocator.

nsComponentManager.cpp actually uses the wrong DeAllocator. The rest of this is
whitespace, unreachable/silly code, and minor cleanup.
Attached patch for review only (obsolete) — Splinter Review
Attached patch the complete patch (obsolete) — Splinter Review
Depends on: 172416
Attached patch new patch -u25 (obsolete) — Splinter Review
Attachment #101401 - Attachment is obsolete: true
Attachment #101402 - Attachment is obsolete: true
Attached patch same changes -uw (obsolete) — Splinter Review
Should you create an inline IsDoneImpl function so we don't incure nested
virtual calls? It would make it more efficient, but less flexable. Someone
overriding IsDone wouldn't necessarily get the behavior they expect. But I don't
think that's a big issue for how this class would be used.
Attachment #102000 - Attachment is obsolete: true
Attachment #102001 - Attachment is obsolete: true
Comment on attachment 102082 [details] [diff] [review]
leaving IsDone alone for now

Why?

     PR_Free(cidString);
-    PR_FREEIF(contractID);
-    PR_FREEIF(className);
+    if (contractID)
+	 PR_Free(contractID);
+    if (className)
+	 PR_Free(className);
+

Revert that please and r=dougt
Attachment #102082 - Flags: review+
http://lxr.mozilla.org/nspr/source/nsprpub/pr/include/prmem.h#152

140 #define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
152 #define PR_FREEIF(_ptr) if (_ptr) PR_DELETE(_ptr)

the result is that PR_FREEIF wastefully assigns null to local variables which
are about to leave scope.
Comment on attachment 102082 [details] [diff] [review]
leaving IsDone alone for now

sr=darin
Attachment #102082 - Flags: superreview+
i wouldn't be surprised if the set was optimized out.  i retract my nit.
fixed
filed bug 173260 for IsDone
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: