| 156 | } |
| 157 | |
| 158 | static bool |
| 159 | initializePolicy(FetchPolicy *&policy, const char *policyName) |
| 160 | { |
| 161 | bool status = true; |
| 162 | if (nullptr == policy) { |
| 163 | policy = FetchPolicy::getInstance(policyName); |
| 164 | if (nullptr == policy) { |
| 165 | PrefetchError("failed to initialize the %s policy", policyName); |
| 166 | status = false; |
| 167 | } |
| 168 | } else { |
| 169 | PrefetchDebug("state already initialized"); |
| 170 | } |
| 171 | return status; |
| 172 | } |
| 173 | |
| 174 | bool |
| 175 | initializeMetrics(PrefetchMetricInfo metrics[], const PrefetchConfig &config) |