Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define FIRST_FIT 0
- #define NEXT_FIT 1
- #define BEST_FIT 2
- #define WORST_FIT 3
- #define RANDOM_FIT 4
- int CUSTOM_MEM_POLICY = FIRST_FIT;
- void do_cyclemempolicy(void){
- CUSTOM_MEM_POLICY = (CUSTOM_MEM_POLICY + 1) % 5;
- printf("mem policy is %d \n", CUSTOM_MEM_POLICY);
- return;
- }
- int main() {
- for (int i = 0; i < 10; i++){
- printf("Calling custom mem policy:\n");
- do_cyclemempolicy();
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment