moveable_pool.git
7 years agoImplement simulated BLOCK_SIZE, hash create and check simulated block contents
Nick Downing [Sat, 23 Mar 2019 22:55:43 +0000 (09:55 +1100)]
Implement simulated BLOCK_SIZE, hash create and check simulated block contents

7 years agoMake n_blocks the primary size and table_size only given if indirect (was the other...
Nick Downing [Sat, 23 Mar 2019 21:46:23 +0000 (08:46 +1100)]
Make n_blocks the primary size and table_size only given if indirect (was the other way around, making block stuff use either table_size or n_blocks), fix bugs

7 years agoSubroutinize the hashing initialization and verification, to avoid duplication
Nick Downing [Sat, 23 Mar 2019 06:22:24 +0000 (17:22 +1100)]
Subroutinize the hashing initialization and verification, to avoid duplication

7 years agoPrint message like 'alloc NN NN true|false' and then perform the operation and then...
Nick Downing [Sat, 23 Mar 2019 05:50:59 +0000 (16:50 +1100)]
Print message like 'alloc NN NN true|false' and then perform the operation and then '... ok', so that we can see clearly what messages come from what operation

7 years agoRemove the reservation of spare space from pool object, core and swap modules
Nick Downing [Sat, 23 Mar 2019 04:44:49 +0000 (15:44 +1100)]
Remove the reservation of spare space from pool object, core and swap modules

7 years agoImplement INDIRECT_CORE, fix calculations so that PREALLOCATE_CORE make sense
Nick Downing [Tue, 19 Mar 2019 13:13:23 +0000 (00:13 +1100)]
Implement INDIRECT_CORE, fix calculations so that PREALLOCATE_CORE make sense

7 years agoFor direct swap, store data in swap_block_mem not swap_table_mem, also for core
Nick Downing [Tue, 19 Mar 2019 10:36:45 +0000 (21:36 +1100)]
For direct swap, store data in swap_block_mem not swap_table_mem, also for core

7 years agoAdd INDIRECT_SWAP option
Nick Downing [Tue, 19 Mar 2019 10:11:51 +0000 (21:11 +1100)]
Add INDIRECT_SWAP option

7 years agoInsert table_ in most core.c / swap.c functions e.g. core_alloc() becomes core_table_...
Nick Downing [Mon, 18 Mar 2019 10:24:39 +0000 (21:24 +1100)]
Insert table_ in most core.c / swap.c functions e.g. core_alloc() becomes core_table_alloc(), because there will soon be an allocator for random block storage

7 years agoImplement MOVEABLE_CORE and MOVEABLE_SWAP compile time options
Nick Downing [Sun, 17 Mar 2019 03:23:55 +0000 (14:23 +1100)]
Implement MOVEABLE_CORE and MOVEABLE_SWAP compile time options

7 years agoFix a bug of requiring a certain amount of free swap, when swap is preallocated
Nick Downing [Sun, 17 Mar 2019 03:16:54 +0000 (14:16 +1100)]
Fix a bug of requiring a certain amount of free swap, when swap is preallocated

7 years agoFix a bug of victim_core_size being used uninitialized without PREALLOCATE_CORE
Nick Downing [Sun, 17 Mar 2019 03:00:27 +0000 (14:00 +1100)]
Fix a bug of victim_core_size being used uninitialized without PREALLOCATE_CORE

7 years agoImplement PREALLOCATE_CORE and PREALLOCATE_SWAP compile time options
Nick Downing [Sun, 17 Mar 2019 02:24:46 +0000 (13:24 +1100)]
Implement PREALLOCATE_CORE and PREALLOCATE_SWAP compile time options

7 years agoImprove use of alloc()/realloc()/free() to remove allocs and reallocs of size 0
Nick Downing [Sat, 16 Mar 2019 22:27:26 +0000 (09:27 +1100)]
Improve use of alloc()/realloc()/free() to remove allocs and reallocs of size 0

7 years agoTidy up debugging code
Nick Downing [Sat, 16 Mar 2019 14:03:15 +0000 (01:03 +1100)]
Tidy up debugging code

7 years agoReplace core_item and swap_item in the process structure with just pool_item
Nick Downing [Sat, 16 Mar 2019 13:58:21 +0000 (00:58 +1100)]
Replace core_item and swap_item in the process structure with just pool_item

7 years agoKeep process and victim pool items in dedicated storage during swapping (should gener...
Nick Downing [Sat, 16 Mar 2019 13:47:56 +0000 (00:47 +1100)]
Keep process and victim pool items in dedicated storage during swapping (should generate smaller code, also ensures a process has only one pool item at a time)

7 years agoDon't track victim or in-swap processes in LRU list (should've thought of this)
Nick Downing [Sat, 16 Mar 2019 12:43:33 +0000 (23:43 +1100)]
Don't track victim or in-swap processes in LRU list (should've thought of this)

7 years agoUse process->size == -1 to mark free process not process->lru_item.prev == NULL
Nick Downing [Sat, 16 Mar 2019 11:36:31 +0000 (22:36 +1100)]
Use process->size == -1 to mark free process not process->lru_item.prev == NULL

7 years agoReverse swap addressing, so that swap is allocated from top down, and copies between...
Nick Downing [Fri, 15 Mar 2019 23:55:25 +0000 (10:55 +1100)]
Reverse swap addressing, so that swap is allocated from top down, and copies between memory and swap always go forward with respect to the actual backing store

7 years agoCombine in-core and in-swap LRU list, using global victim pointer to first swap
Nick Downing [Fri, 15 Mar 2019 13:21:48 +0000 (00:21 +1100)]
Combine in-core and in-swap LRU list, using global victim pointer to first swap

7 years agoMake the current victim be stored at head of in-swap LRU list instead of tail of...
Nick Downing [Fri, 15 Mar 2019 13:02:52 +0000 (00:02 +1100)]
Make the current victim be stored at head of in-swap LRU list instead of tail of in-core LRU list, strengthen invariants about core and/or swap membership

7 years agoUse #define to improve casting for lru_item vs process pointers
Nick Downing [Fri, 15 Mar 2019 07:59:39 +0000 (18:59 +1100)]
Use #define to improve casting for lru_item vs process pointers

7 years agoChange process_head/process_item to lru_head/lru_item which is more descriptive
Nick Downing [Fri, 15 Mar 2019 07:17:04 +0000 (18:17 +1100)]
Change process_head/process_item to lru_head/lru_item which is more descriptive

7 years agoProcess test, it is based on the pool test but involves two pools, one representing...
Nick Downing [Thu, 14 Mar 2019 14:31:39 +0000 (01:31 +1100)]
Process test, it is based on the pool test but involves two pools, one representing core and the other representing swap, and a new command 'run' which moves the given process fully into core, using an LRU algorithm to boot out some others

7 years agoInitial commit, seemingly correct malloc/realloc/free pool implementation, where...
Nick Downing [Mon, 11 Mar 2019 01:58:08 +0000 (12:58 +1100)]
Initial commit, seemingly correct malloc/realloc/free pool implementation, where the user supplies the control blocks (instead of them appearing at the start of an allocation), and existing allocations can be moved to make room as needed