Skip to content

Instantly share code, notes, and snippets.

@porglezomp
Last active November 4, 2018 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save porglezomp/ec4cfe3dcacc46f4b57517c56e4634d4 to your computer and use it in GitHub Desktop.
Save porglezomp/ec4cfe3dcacc46f4b57517c56e4634d4 to your computer and use it in GitHub Desktop.
# Memory Eviction
# Memory Eviction
Start*
swap page -> NoRW
file page -> NoRW
NoRW
read -> Read
write -> ReadWrite
queue -> Start
Read
write -> ReadWrite
queue -> NoRW
ReadWrite
queue -> NoRW
let dirty = false;
function render(model) {
let current_state_name = model.active_states[0].name;
if (current_state_name === "ReadWrite") {
dirty = true;
} else if (current_state_name === "Start") {
dirty = false;
}
let referenced = current_state_name === "Read" ||
current_state_name === "ReadWrite";
return $("ul",
$("li", `State: ${current_state_name}`),
$("li", `Dirty: ${dirty}`),
$("li", `Referenced: ${referenced}`),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment