Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Segment_map Class Reference

A segment map associates segment index numbers with their corresponding page counts (the number of pages a segment contains). More...

#include <segment.h>

Inherits Address_map.

Inheritance diagram for Segment_map:

Inheritance graph
[legend]
Collaboration diagram for Segment_map:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void set_pages_count (unsigned segment, Size pages_count)
Size get_pages_count (unsigned segment)
bool is_segment_free (unsigned segment)

Detailed Description

A segment map associates segment index numbers with their corresponding page counts (the number of pages a segment contains).

Incidentally, a segment map is also handy for keeping track of which segments are unused. A segment usage bitmap might be better for scanning for free segments, but this will do for now.


Member Function Documentation

Size Segment_map::get_pages_count unsigned  segment  ) 
 

Return the number of pages contained within the given segment.

bool Segment_map::is_segment_free unsigned  segment  ) 
 

Return whether the given segment is unused.

void Segment_map::set_pages_count unsigned  segment,
Size  pages_count
 

Set the number of pages contained within the given segment.


The documentation for this class was generated from the following files:

Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman