Name
Memory Algorithms -- Interface for Algorithms.
Description
Great effort has been devoted to making the addicion of new algorithms as easy
as posible, here is documented what there is to know to be able to write your
own algorithms.
Details
struct mem_algorithm_t
typedef struct { /* This struct is all
that we know about
each algorithm */
gchar * name;
void (*select) (void);
void (*unselect) (void); /* These two functions
will be called before
and after the use of
an algorithm to let
it keep a low memory
usage when not in
use.*/
GtkWidget * properties; /* Each algorithm will
maintain it's own
properties widget.
NULL means "no
properties". It
should be set to NULL
when destroyed. If
not destroyed in
"unselect" the system
will destroy it.*/
void (*page_access) (gint pid, gint page); /* lets the algorithm
keep track of page
accesses */
gint (*select_frame) (void); /* it should return a
frame to be assigned
when out of memory */
} mem_algorithm_t; |
get_MEM_current_algorithm ()
Find out which is the current algorithm.
init_MEM_algorithms ()
GSList* init_MEM_algorithms (void); |
Initializes the MEM algorithms code.
Mainly will call init functions for each algorithm.
register_MEM_algorithm ()
Each algorithm should call this function in it's initialization function
to register its algorithm struct.