Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SubAlloc.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  {
  UNIT_SIZE = 12, N1 = 4, N2 = 4, N3 = 4,
  N4 = (128+3-1*N1-2*N2-3*N3)/4, N_INDEXES = N1+N2+N3+N4
}

Functions

void PrefetchData (void *Addr)
UINT U2B (UINT NU)
void SplitBlock (void *pv, UINT OldIndx, UINT NewIndx)
DWORD _STDCALL GetUsedMemory ()
void _STDCALL StopSubAllocator ()
BOOL _STDCALL StartSubAllocator (UINT SASize)
static void InitSubAllocator ()
static void GlueFreeBlocks ()
static void *_STDCALL AllocUnitsRare (UINT indx)
void * AllocUnits (UINT NU)
void * AllocContext ()
void UnitsCpy (void *Dest, void *Src, UINT NU)
void * ExpandUnits (void *OldPtr, UINT OldNU)
void * ShrinkUnits (void *OldPtr, UINT OldNU, UINT NewNU)
void FreeUnits (void *ptr, UINT NU)
void SpecialFreeUnit (void *ptr)
void * MoveUnitsUp (void *OldPtr, UINT NU)
static void ExpandTextArea ()

Variables

BLK_NODE BList [N_INDEXES]
MEM_BLK _PACK_ATTR
static BYTE Indx2Units [N_INDEXES]
static BYTE Units2Indx [128]
static DWORD GlueCount
static DWORD SubAllocatorSize = 0
static BYTEHeapStart
static BYTEpText
static BYTEUnitsStart
static BYTELoUnit
static BYTEHiUnit


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
UNIT_SIZE 
N1 
N2 
N3 
N4 
N_INDEXES 

Definition at line 8 of file SubAlloc.h.


Function Documentation

void* AllocContext  )  [inline]
 

Definition at line 130 of file SubAlloc.h.

References AllocUnitsRare(), BLK_NODE::avail(), BList, HiUnit, LoUnit, BLK_NODE::remove(), and UNIT_SIZE.

Referenced by CreateSuccessors(), and StartModelRare().

void* AllocUnits UINT  NU  )  [inline]
 

Definition at line 122 of file SubAlloc.h.

References AllocUnitsRare(), BList, HiUnit, Indx2Units, LoUnit, BLK_NODE::remove(), U2B(), and Units2Indx.

Referenced by ExpandUnits(), StartModelRare(), and UpdateModel().

static void* _STDCALL AllocUnitsRare UINT  indx  )  [static]
 

Definition at line 106 of file SubAlloc.h.

References BList, GlueCount, GlueFreeBlocks(), i, Indx2Units, N_INDEXES, NULL, pText, BLK_NODE::remove(), SplitBlock(), U2B(), and UnitsStart.

Referenced by AllocContext(), and AllocUnits().

static void ExpandTextArea  )  [inline, static]
 

Definition at line 187 of file SubAlloc.h.

References BList, i, N_INDEXES, BLK_NODE::next, MEM_BLK::NU, p, BLK_NODE::Stamp, UL, Units2Indx, UnitsStart, and BLK_NODE::unlink().

Referenced by RestoreModelRare().

void* ExpandUnits void *  OldPtr,
UINT  OldNU
[inline]
 

Definition at line 145 of file SubAlloc.h.

References AllocUnits(), BList, BLK_NODE::insert(), Units2Indx, and UnitsCpy().

Referenced by UpdateModel().

void FreeUnits void *  ptr,
UINT  NU
[inline]
 

Definition at line 167 of file SubAlloc.h.

References BList, Indx2Units, BLK_NODE::insert(), and Units2Indx.

Referenced by PPM_CONTEXT::cutOff(), PPM_CONTEXT::removeBinConts(), and PPM_CONTEXT::rescale().

DWORD _STDCALL GetUsedMemory  ) 
 

Definition at line 53 of file SubAlloc.h.

References BList, HiUnit, i, Indx2Units, LoUnit, N_INDEXES, pText, BLK_NODE::Stamp, SubAllocatorSize, UNIT_SIZE, and UnitsStart.

Referenced by RestoreModelRare().

static void GlueFreeBlocks  )  [static]
 

Definition at line 80 of file SubAlloc.h.

References BLK_NODE::avail(), BList, GlueCount, HiUnit, i, Indx2Units, BLK_NODE::insert(), BLK_NODE::link(), LoUnit, N_INDEXES, MEM_BLK::NU, NULL, p, BLK_NODE::remove(), UL, and Units2Indx.

Referenced by AllocUnitsRare().

static void InitSubAllocator  )  [inline, static]
 

Definition at line 73 of file SubAlloc.h.

References BList, GlueCount, HeapStart, HiUnit, LoUnit, pText, SubAllocatorSize, UNIT_SIZE, and UnitsStart.

Referenced by StartModelRare().

void* MoveUnitsUp void *  OldPtr,
UINT  NU
[inline]
 

Definition at line 176 of file SubAlloc.h.

References BList, Indx2Units, BLK_NODE::insert(), BLK_NODE::remove(), U2B(), Units2Indx, UnitsCpy(), and UnitsStart.

Referenced by PPM_CONTEXT::cutOff().

void PrefetchData void *  Addr  )  [inline]
 

Definition at line 31 of file SubAlloc.h.

Referenced by PPM_CONTEXT::cutOff(), DecodeFile(), PPM_CONTEXT::decodeSymbol1(), EncodeFile(), PPM_CONTEXT::encodeSymbol1(), PPM_CONTEXT::makeEscFreq2(), and PPM_CONTEXT::removeBinConts().

void* ShrinkUnits void *  OldPtr,
UINT  OldNU,
UINT  NewNU
[inline]
 

Definition at line 155 of file SubAlloc.h.

References BList, Indx2Units, BLK_NODE::insert(), BLK_NODE::remove(), SplitBlock(), Units2Indx, and UnitsCpy().

Referenced by PPM_CONTEXT::refresh(), and PPM_CONTEXT::rescale().

void SpecialFreeUnit void *  ptr  )  [inline]
 

Definition at line 171 of file SubAlloc.h.

References BList, BLK_NODE::insert(), UL, UNIT_SIZE, and UnitsStart.

Referenced by PPM_CONTEXT::cutOff(), and RestoreModelRare().

void SplitBlock void *  pv,
UINT  OldIndx,
UINT  NewIndx
[inline]
 

Definition at line 43 of file SubAlloc.h.

References BList, i, Indx2Units, BLK_NODE::insert(), p, U2B(), and Units2Indx.

Referenced by AllocUnitsRare(), and ShrinkUnits().

BOOL _STDCALL StartSubAllocator UINT  SASize  ) 
 

Definition at line 65 of file SubAlloc.h.

References FALSE, HeapStart, NULL, StopSubAllocator(), SubAllocatorSize, t, and TRUE.

Referenced by UnPPM().

void _STDCALL StopSubAllocator  ) 
 

Definition at line 60 of file SubAlloc.h.

References HeapStart, and SubAllocatorSize.

Referenced by StartSubAllocator(), and UnPPM().

UINT U2B UINT  NU  )  [inline]
 

Definition at line 42 of file SubAlloc.h.

Referenced by AllocUnits(), AllocUnitsRare(), MoveUnitsUp(), and SplitBlock().

void UnitsCpy void *  Dest,
void *  Src,
UINT  NU
[inline]
 

Definition at line 136 of file SubAlloc.h.

Referenced by ExpandUnits(), MoveUnitsUp(), and ShrinkUnits().


Variable Documentation

MEM_BLK _PACK_ATTR
 

struct BLK_NODE BList[N_INDEXES]
 

Referenced by AllocContext(), AllocUnits(), AllocUnitsRare(), ExpandTextArea(), ExpandUnits(), FreeUnits(), GetUsedMemory(), GlueFreeBlocks(), InitSubAllocator(), MoveUnitsUp(), RestoreModelRare(), ShrinkUnits(), SpecialFreeUnit(), and SplitBlock().

DWORD GlueCount [static]
 

Definition at line 28 of file SubAlloc.h.

Referenced by AllocUnitsRare(), GlueFreeBlocks(), InitSubAllocator(), and RestoreModelRare().

BYTE* HeapStart [static]
 

Definition at line 29 of file SubAlloc.h.

Referenced by InitSubAllocator(), ReduceOrder(), RestoreModelRare(), StartSubAllocator(), StopSubAllocator(), and UpdateModel().

BYTE * HiUnit [static]
 

Definition at line 29 of file SubAlloc.h.

Referenced by AllocContext(), AllocUnits(), GetUsedMemory(), GlueFreeBlocks(), and InitSubAllocator().

BYTE Indx2Units[N_INDEXES] [static]
 

Definition at line 27 of file SubAlloc.h.

Referenced by AllocUnits(), AllocUnitsRare(), FreeUnits(), GetUsedMemory(), GlueFreeBlocks(), MoveUnitsUp(), PPMD_STARTUP::PPMD_STARTUP(), ShrinkUnits(), and SplitBlock().

BYTE * LoUnit [static]
 

Definition at line 29 of file SubAlloc.h.

Referenced by AllocContext(), AllocUnits(), GetUsedMemory(), GlueFreeBlocks(), and InitSubAllocator().

BYTE * pText [static]
 

Definition at line 29 of file SubAlloc.h.

Referenced by AllocUnitsRare(), GetUsedMemory(), InitSubAllocator(), ReduceOrder(), RestoreModelRare(), and UpdateModel().

DWORD SubAllocatorSize = 0 [static]
 

Definition at line 28 of file SubAlloc.h.

Referenced by GetUsedMemory(), InitSubAllocator(), RestoreModelRare(), StartSubAllocator(), and StopSubAllocator().

BYTE Units2Indx[128] [static]
 

Definition at line 27 of file SubAlloc.h.

Referenced by AllocUnits(), ExpandTextArea(), ExpandUnits(), FreeUnits(), GlueFreeBlocks(), MoveUnitsUp(), PPMD_STARTUP::PPMD_STARTUP(), ShrinkUnits(), and SplitBlock().

BYTE * UnitsStart [static]
 

Definition at line 29 of file SubAlloc.h.

Referenced by AllocUnitsRare(), PPM_CONTEXT::cutOff(), DecodeFile(), EncodeFile(), ExpandTextArea(), GetUsedMemory(), InitSubAllocator(), MoveUnitsUp(), PPM_CONTEXT::removeBinConts(), SpecialFreeUnit(), and UpdateModel().


Generated on Sat Nov 5 16:50:29 2005 for OPIE by  doxygen 1.4.2