internal static int markPage(StorageImpl db, int pageId, ClassDescriptor.FieldType type, int height)
 {
     Debug.Assert(pageId != 0);
     Page pg = db.getGCPage(pageId);
     int nPages = 1;
     try 
     { 
         int i, n = getnItems(pg);
         if (--height != 0) 
         {
             if (type == ClassDescriptor.FieldType.tpString || type == ClassDescriptor.FieldType.tpArrayOfByte) 
             { // page of strings
                 for (i = 0; i <= n; i++) 
                 { 
                     nPages += markPage(db, getKeyStrOid(pg, i), type, height);
                 }
             } 
             else 
             { 
                 for (i = 0; i <= n; i++) 
                 { 
                     nPages += markPage(db, getReference(pg, maxItems-i-1), type, height);
                 }
             }
         } 
         else 
         { 
             if (type == ClassDescriptor.FieldType.tpString || type == ClassDescriptor.FieldType.tpArrayOfByte) 
             { // page of strings
                 for (i = 0; i < n; i++) 
                 {
                     db.markOid(getKeyStrOid(pg, i));
                 }
             }
             else 
             { // page of scalars
                 for (i = 0; i < n; i++) 
                 { 
                     db.markOid(getReference(pg, maxItems-1-i));
                 }
             } 
         }
     } 
     finally 
     { 
         db.pool.unfix(pg);
     }
     return nPages;
 }