fredag 30 december 2011

w2d4: Splitting chunks

Split chunks
Tests for split chunk item for multiple vertical (i.e. decreasing k) and horizontal (increasing free list) steps.
  • zero (k=0)
  • one (k=1)
  • two (k=2)
  • one w/ multiple splits

Request chunks
The first version of the test contained the functionality for a new function, request_chunk(). Moved out the specific tests for split_chunk_item() and tested request_chunk() specifically.  It gives you an available chunk or splits blocks creating new ones as needed.

The first chunk request for k will split the A cell of k+1. The second chunk request for k must therefore split the B cell of k+1. At the moment, the chunk (containing both A and B) is returned, which the client code must check to see which cell is free.

Inga kommentarer:

Skicka en kommentar