Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields  

Toy Memory Manager Interface
[Commandline Interface]


Modules

Toy Command Interpreter

Data Structures

struct  InvPageTable
 Info about each page #. More...

struct  ToyMM
 Structure that defines a Toy Memory Manager. More...


Defines

#define MAX_PROCESSES   10
 Maximum number of processes.

#define MIN_MEMSIZE   1000
 Minimum allowable number of memory elements.

#define TMM_CONSOLE_PROMPT   "[%03d]$ "

Typedefs

typedef InvPageTable InvPageTable
 Info about each page #.

typedef ToyMM ToyMM
 Structure that defines a Toy Memory Manager.

typedef enum ErrMessage_t ErrMessage_t
 Enumerated type listing valid error return values.


Functions

ToyMM * TMM_Create (int memSize)
 Creates a new Toy Memory Manager.

ErrMessage_t TMM_Free (ToyMM *tmm)
 Frees a Toy Memory Manager.

int TMM_ParseFile (const char *fname, ToyMM *tm)
 Function to parse a commandfile.

int TMM_ParseFilePtr (FILE *fp, ToyMM *tm, int prompt)
 Just like TMM_ParseFile, except Parses input from file pointer.


Detailed Description

This is the simple external interface for the Toy Memory Manager. The only functions exported are TMM_Create, TMM_Free, and TMM_ParseFile.

Define Documentation

#define MAX_PROCESSES   10
 

Maximum number of processes.

Definition at line 28 of file ToyMem.h.

Referenced by TMM_AllocateHeap(), TMM_Create(), TMM_EnablePaging(), TMM_Free(), TMM_FreeHeap(), TMM_PagedAllocateProcess(), TMM_ParseLine(), TMM_PrintHeap(), TMM_PrintPages(), TMM_PrintPageTable(), TMM_PrintProcessMemory(), TMM_PrintProcessTable(), TMM_ReallocateHeap(), TMM_StoreHeapInteger(), TMM_StoreHeapString(), and TMM_SwapCreate().

#define MIN_MEMSIZE   1000
 

Minimum allowable number of memory elements.

Definition at line 30 of file ToyMem.h.


Typedef Documentation

typedef enum ErrMessage_t ErrMessage_t
 

Enumerated type listing valid error return values.

All values except ERR_UNKNOWN and ERR_NONE have accompanying values in the string table ErrMessages[], for example ErrMessages[ERR_INVALIDINPUT]

Referenced by main(), TMM_AllocateHeap(), TMM_EnablePaging(), TMM_Free(), TMM_FreeHeap(), TMM_PagedAllocateProcess(), TMM_PagedTerminateProcess(), TMM_ParseFilePtr(), TMM_ParseLine(), TMM_PrintAllMemory(), TMM_PrintFrames(), TMM_PrintHeap(), TMM_PrintInvertedPageTable(), TMM_PrintPages(), TMM_PrintPageTable(), TMM_PrintProcessMemory(), TMM_PrintProcessTable(), TMM_ReallocateHeap(), TMM_StoreHeapInteger(), TMM_StoreHeapString(), TMM_StoreInteger(), TMM_StoreString(), TMM_TerminateProcess(), and TMM_WatchPaging().

typedef struct InvPageTable InvPageTable
 

Info about each page #.

typedef struct ToyMM ToyMM
 

Structure that defines a Toy Memory Manager.

Contains an array of pointers to processes(NULL denotes no process), an array of memory elements, a linked list of free space, and a member describing the size of the memory array.


Function Documentation

ToyMM* TMM_Create int    memSize
 

Creates a new Toy Memory Manager.

See also:
TMM_Free()

Definition at line 466 of file ToyMem.c.

References invPageTable, MAX_PROCESSES, mem, memFree, memSize, page, pageSize, processList, swap, TMM_CreateSegList(), ToyMem::type, and watchPaging.

Referenced by main().

ErrMessage_t TMM_Free ToyMM   tmm
 

Frees a Toy Memory Manager.

See also:
TMM_Create()

Definition at line 511 of file ToyMem.c.

References ErrMessage_t, invPageTable, MAX_PROCESSES, mem, memFree, processList, TMM_FreeSegList(), TMM_PagedTerminateProcess(), TMM_PagingEnabled(), TMM_SwapDestroy(), and TMM_TerminateProcess().

Referenced by main().

int TMM_ParseFile const char *    fname,
ToyMM   tm
 

Function to parse a commandfile.

Definition at line 779 of file ToyMem.c.

References TMM_ParseFilePtr().

Referenced by main().

int TMM_ParseFilePtr FILE *    fp,
ToyMM   tm,
int    prompt
 

Just like TMM_ParseFile, except Parses input from file pointer.

if prompt is nonzero, a console prompt is printed to stdout before each line is read.

Definition at line 712 of file ToyMem.c.

References ErrMessage_t, PRINT_ERROR, and TMM_ParseLine().

Referenced by TMM_ParseFile().


Generated on Fri Apr 4 14:29:08 2003 for ToyMem by doxygen1.3-rc3