Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

buffers.h

Go to the documentation of this file.
00001 /*
00002  * buffers.h
00003  *
00004  * Turbo Vision - Version 2.0
00005  *
00006  * Copyright (c) 1994 by Borland International
00007  * All Rights Reserved.
00008  *
00009  * Modified by Sergio Sigala <sergio@sigala.it>
00010  */
00011 
00012 #if defined( Uses_TVMemMgr ) && !defined( __TVMemMgr )
00013 #define __TVMemMgr
00014 
00026 const int DEFAULT_SAFETY_POOL_SIZE = 4096;
00027 
00036 class TBufListEntry
00037 {
00038 private:
00039     TBufListEntry( void*& );
00040     ~TBufListEntry();
00041     void *operator new( size_t, size_t );
00059     void *operator new( size_t sz );
00068     void operator delete( void * );
00069     TBufListEntry *next;
00070     TBufListEntry *prev;
00071     void*& owner;
00072     static TBufListEntry *bufList;
00073     static Boolean freeHead();
00074     friend class TVMemMgr;
00075     friend void *operator new( size_t );
00076     friend void * allocBlock( size_t );
00077 };
00078 
00088 class TVMemMgr
00089 {
00090 public:
00104     TVMemMgr();
00116     static void resizeSafetyPool( size_t sz = DEFAULT_SAFETY_POOL_SIZE );
00121     static int safetyPoolExhausted();
00122 #ifndef __UNPATCHED
00123 
00126     static void clearSafetyPool();
00127 #endif
00128 
00137     static void allocateDiscardable( void *&adr, size_t sz );
00145     static void freeDiscardable( void * );
00146 #ifndef __UNPATCHED
00147 
00150     static void suspend(void);
00151 #endif
00152 private:
00159     static void * safetyPool;
00168     static size_t safetyPoolSize;
00173     static int inited;
00174     static int initMemMgr();
00175 };
00176 
00177 #endif  // Uses_TVMemMgr

Generated at Sat Sep 22 20:19:07 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001