Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Functions
vm.c File Reference
#include "vm_mmap.c"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FreeBlock
struct  VM

Defines

#define GCPRINT   fprintf
#define GCOUTF   stderr
#define BLOCKFREE_CACHE_SIZE   96

Typedefs

typedef struct VM VM

Functions

static size_t vm_round_up_to_page_size (size_t len, size_t page_size)
static VMvm_create ()
static void vm_free (VM *vm)
static size_t vm_memory_allocated (VM *vm)
static size_t vm_memory_allocated_inc (VM *vm, size_t len)
static size_t vm_memory_allocated_dec (VM *vm, size_t len)

Class Documentation

struct FreeBlock

Definition at line 17 of file vm.c.

Class Members
short age
long len
void * start
short zeroed
struct VM

Definition at line 25 of file vm.c.

Collaboration diagram for VM:
Class Members
FreeBlock * freeblocks
size_t memory_allocated

Define Documentation

#define BLOCKFREE_CACHE_SIZE   96
#define GCOUTF   stderr

Definition at line 8 of file vm.c.

#define GCPRINT   fprintf

Definition at line 7 of file vm.c.


Typedef Documentation

typedef struct VM VM

Function Documentation

static VM* vm_create ( ) [static]

Definition at line 32 of file vm.c.

                       {
  VM *vm = ofm_malloc(sizeof(VM));
  memset(vm, 0, sizeof(VM));
#if !( defined(_WIN32) || defined(OSKIT) )
  #define BLOCKFREE_CACHE_SIZE 96
  vm->freeblocks = ofm_malloc(sizeof(FreeBlock) * BLOCKFREE_CACHE_SIZE);
  memset(vm->freeblocks, 0, sizeof(FreeBlock) * BLOCKFREE_CACHE_SIZE);
#endif
  return vm;
}

Here is the caller graph for this function:

static void vm_free ( VM vm) [static]

Definition at line 43 of file vm.c.

                            {
#if !( defined(_WIN32) || defined(OSKIT) )
  free(vm->freeblocks);
#endif
  free(vm);
}

Here is the caller graph for this function:

static size_t vm_memory_allocated ( VM vm) [static]

Definition at line 50 of file vm.c.

                                          {
  return vm->memory_allocated;
}

Here is the caller graph for this function:

static size_t vm_memory_allocated_dec ( VM vm,
size_t  len 
) [static]

Definition at line 59 of file vm.c.

                                                          {
  vm->memory_allocated -= len;
  return vm->memory_allocated;
}

Here is the caller graph for this function:

static size_t vm_memory_allocated_inc ( VM vm,
size_t  len 
) [static]

Definition at line 54 of file vm.c.

                                                          {
  vm->memory_allocated += len;
  return vm->memory_allocated;
}

Here is the caller graph for this function:

static size_t vm_round_up_to_page_size ( size_t  len,
size_t  page_size 
) [inline, static]

Definition at line 11 of file vm.c.

                                                                            {
  len += (page_size -1) - (len & (page_size - 1));
  return len;
};