Class BoundaryTagAllocator

Class Documentation

class BoundaryTagAllocator

the dynamic storage allocation with boundary tags

Public Types

enum class Fit

the block chosen for a request

Values:

enumerator FIRST
enumerator BEST
enumerator NEXT

Public Functions

explicit BoundaryTagAllocator(long N, Fit fit = Fit::FIRST)

a memory of N words, all free

Pre:

N >= 4

long allocate(long n)

a block of at least n words, or -1

Pre:

n >= 1

void free(long a)

frees the block at a

Pre:

a was given by allocate() and is in use

long freeWords(void) const

the words in free blocks

long freeBlocks(void) const

the number of free blocks