Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #8 from facebook/add_volatile_to_memoized_yc
Browse files Browse the repository at this point in the history
Added volatile keyword to memoized YearClass
  • Loading branch information
rrong committed Apr 1, 2015
2 parents 12b4aa4 + 6e28605 commit a7b5bf1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class YearClass {
private static final long MB = 1024 * 1024;
private static final int MHZ_IN_KHZ = 1000;

private static Integer mYearCategory;
private volatile static Integer mYearCategory;

/**
* Entry Point of YearClass. Extracts YearClass variable with memoizing.
Expand Down Expand Up @@ -168,4 +168,4 @@ private static int getRamYear(Context c) {
if (totalRam <= 2048 * MB) return CLASS_2013;
return CLASS_2014;
}
}
}

0 comments on commit a7b5bf1

Please sign in to comment.