Closed Bug 297714 Opened 19 years ago Closed 19 years ago

Memory cache should use PR_GetPhysicalMemorySize

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: darin.moz)

References

Details

Attachments

(1 file)

 
Attached patch patchSplinter Review
Attachment #186258 - Flags: superreview?(darin)
Attachment #186258 - Flags: review?(darin)
Comment on attachment 186258 [details] [diff] [review]
patch

>Index: nsCacheService.cpp

>+    PRUint64 bytes = PR_GetPhysicalMemorySize();
> 
>+    if (bytes == 0)  return 0;

nit: return on new line so a breakpoint can be set on return.

also, shouldn't this be comparing against LL_ZERO instead?


>+    // Conversion from unsigned int64 to double doesn't work on all platforms.
>+    // We need to truncate the value at LL_MAXINT to make sure we don't
>+    // overflow.
>+    if (LL_CMP(bytes, >, LL_MAXINT))
>+        bytes = LL_MAXINT;
> 
>+    double bytesD;
>+    LL_L2D(bytesD, (PRInt64) bytes);
> 
>+    double x = log(bytesD)/log((double)2) - 14;

nit: "2.0" instead of "(double)2"


otherwise, it looks good.
Attachment #186258 - Flags: superreview?(darin)
Attachment #186258 - Flags: superreview+
Attachment #186258 - Flags: review?(darin)
Attachment #186258 - Flags: review+
Blocks: 210481
Comment on attachment 186258 [details] [diff] [review]
patch

Requesting approval for 1.8b3.	This is pretty safe, as we're just moving
functionality into NSPR.
Attachment #186258 - Flags: approval1.8b3?
Attachment #186258 - Flags: approval1.8b3? → approval1.8b3+
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
This caused a large Tp drop on btek.  Was it supposed to?  It doesn't look like
it was.
Yikes!  That seems to suggest that the memory cache size might have increased in
size unexpectedly.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: