int core_block_avail;
#endif
+#ifdef PREALLOCATE_CORE
+int victim_core_blocks;
+#endif
+
static void core_move(struct pool_item *item, int new_base) {
int base = item->base;
int blocks = item->limit - base;
#include <stdint.h>
#include "pool.h"
+//#define PREALLOCATE_CORE 1
//#define INDIRECT_CORE 1
#define MOVEABLE_CORE 1
#define BLOCK_SIZE 0x1000
extern int core_block_avail;
#endif
+#ifdef PREALLOCATE_CORE
+extern int victim_core_blocks;
+#endif
+
#ifdef INDIRECT_CORE
void core_init(int n_table, int n_blocks);
bool core_block_alloc(int *blocks, int size);
struct lru_item lru_head;
struct process *victim;
-#ifdef PREALLOCATE_CORE
-int victim_core_blocks;
-#endif
-#ifdef PREALLOCATE_SWAP
-int victim_swap_blocks;
-#endif
#if 1
// won't work when compiled with NDEBUG
#include "pool.h"
-//#define PREALLOCATE_CORE 1
-#define PREALLOCATE_SWAP 1
-
struct lru_item {
struct lru_item *prev;
struct lru_item *next;
extern struct lru_item lru_head;
extern struct process *victim;
-#ifdef PREALLOCATE_CORE
-extern int victim_core_blocks;
-#else
-extern struct pool_item victim_core_item;
-#endif
-#ifdef PREALLOCATE_SWAP
-extern int victim_swap_blocks;
-#else
-extern struct pool_item victim_swap_item;
-#endif
void process_init(int n, int spare);
bool process_alloc(struct process *process, long size);
int swap_block_avail;
#endif
+#ifdef PREALLOCATE_SWAP
+int victim_swap_blocks;
+#endif
+
static void swap_move(struct pool_item *item, int new_base) {
int base = item->base;
int blocks = item->limit - base;
#include <stdint.h>
#include "pool.h"
+#define PREALLOCATE_SWAP 1
#define INDIRECT_SWAP 1
//#define MOVEABLE_SWAP 1
extern int swap_block_avail;
#endif
+#ifdef PREALLOCATE_SWAP
+extern int victim_swap_blocks;
+#endif
+
#ifdef INDIRECT_SWAP
void swap_init(int n_table, int n_blocks);
bool swap_block_alloc(int *blocks, int size);