If reconfigure is called, it means the emulator state has changed too greatly and we need to abandon captured states and start from scratch.
()
| 276 | * greatly and we need to abandon captured states and start from scratch. |
| 277 | */ |
| 278 | @Override |
| 279 | public void reconfigure() { |
| 280 | boolean resume = computer.pause(); |
| 281 | isValid = false; |
| 282 | |
| 283 | // Now figure out how much memory we're allowed to eat |
| 284 | maxMemory = Runtime.getRuntime().maxMemory(); |
| 285 | // If we have less than 2% heap remaining then states will be recycled |
| 286 | freeRequired = maxMemory / 50L; |
| 287 | frameCounter = captureFrequency; |
| 288 | if (resume) { |
| 289 | computer.resume(); |
| 290 | } |
| 291 | } |
| 292 | boolean isValid = false; |
| 293 | |
| 294 | public void invalidate() { |