Closed Bug 1113200 Opened 9 years ago Closed 9 years ago

Use sysconf to obtain the page size in GonkHal.cpp

Categories

(Core :: Hardware Abstraction Layer (HAL), defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: mwu, Assigned: mwu)

Details

Attachments

(1 file, 1 obsolete file)

This is a bit more portable.
Attachment #8538577 - Flags: review?(dhylands)
Comment on attachment 8538577 [details] [diff] [review]
Use sysconf to obtain the page size in GonkHal.cpp

Review of attachment 8538577 [details] [diff] [review]:
-----------------------------------------------------------------

::: hal/gonk/GonkHal.cpp
@@ +1355,5 @@
>      // adj is in oom_adj units.
>      adjParams.AppendPrintf("%d,", OomAdjOfOomScoreAdj(oomScoreAdj));
>  
>      // minfree is in pages.
> +    minfreeParams.AppendPrintf("%d,", killUnderKB * 1024 / page_size);

nit: %d is an int. dividing by page_size declared as long makes the result as long.

So technically, this should be %ld and probably the only reason this is working is because we're on a little endian machine. Either that or cast the result of the whole expression to int
Attachment #8538577 - Flags: review?(dhylands) → review+
Attachment #8538577 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/7566fcba4be9
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: