home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH09 / A092271.TXT < prev    next >
Encoding:
Text File  |  1993-10-18  |  567 b   |  10 lines

  1. This class demonstrates overloading the "new()" and "delete()"
  2. operators.  "new()" and "delete()" manage a cache.  The use of a
  3. cache reduces the overhead associated with free store allocation.
  4. The cache is an array of "CachedNode"s.  The "next" pointer in
  5. each element of the array points to the adjacent array element,
  6. forming a linked list.  The linked list is called a free list.
  7. When a "CachedNode" is allocated from the cache, it is removed
  8. from the free list.  When the free list is empty, "CachedNode"s
  9. are allocated from free store using "::new()".
  10.