CS318 - Pintos
Pintos source browser for JHU CS318 course
Data Fields
pool Struct Reference

Page allocator. More...

Collaboration diagram for pool:
Collaboration graph
[legend]

Data Fields

struct lock lock
 Mutual exclusion. More...
 
struct bitmapused_map
 Bitmap of free pages. More...
 
uint8_tbase
 Base of pool. More...
 

Detailed Description

Page allocator.

Hands out memory in page-size (or page-multiple) chunks. See malloc.h for an allocator that hands out smaller chunks.

System memory is divided into two "pools" called the kernel and user pools. The user pool is for user (virtual) memory pages, the kernel pool for everything else. The idea here is that the kernel needs to have memory for its own operations even if user processes are swapping like mad.

By default, half of system RAM is given to the kernel pool and half to the user pool. That should be huge overkill for the kernel pool, but that's just fine for demonstration purposes. A memory pool.

Definition at line 29 of file palloc.c.

Field Documentation

◆ base

uint8_t* pool::base

Base of pool.

Definition at line 33 of file palloc.c.

Referenced by init_pool(), page_from_pool(), palloc_free_multiple(), and palloc_get_multiple().

◆ lock

struct lock pool::lock

Mutual exclusion.

Definition at line 31 of file palloc.c.

Referenced by init_pool(), and palloc_get_multiple().

◆ used_map

struct bitmap* pool::used_map

Bitmap of free pages.

Definition at line 32 of file palloc.c.

Referenced by init_pool(), page_from_pool(), palloc_free_multiple(), and palloc_get_multiple().


The documentation for this struct was generated from the following file: