瀏覽代碼

eclcc memory - more savings

Add a comment to the CHqlExpression base classes that have been introduced.

Use CInterfaceOf<IAtom> for implementing atoms

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 13 年之前
父節點
當前提交
3aef1194c7
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 10 0
      ecl/hql/hqlexpr.ipp
  2. 1 3
      system/jlib/jhash.ipp

+ 10 - 0
ecl/hql/hqlexpr.ipp

@@ -267,6 +267,16 @@ public:
     inline void resetTransformExtra(IInterface * _extra, unsigned depth);
 };
 
+//The following couple of classes are here primarily to save memory.  
+//It is preferrable not to artificially introduce extra classes, but one representative large example has
+//12M+ instances, and not including the tables/type save 16 and 8 bytes each.  That quickly becomes a significant
+//amount of memory.
+//
+//The nodes with significant number of instances are (no_assign, no_select and annotations).  
+//One further possibilitiy is to add a CHqlAssignExpression which could also remove the tables and type. 
+//If any more class splitting is contemplated it would be worth revisiting in terms of policies.
+
+//This class calculates which tables the expression references to ensure it is evaluated in the correct conext.
 class HQL_API CHqlExpressionWithTables : public CHqlExpression
 {
 public:

+ 1 - 3
system/jlib/jhash.ipp

@@ -72,11 +72,9 @@ class jlib_decl Mapping : extends MappingBase
 };
 
 
-class jlib_decl AtomBase : implements IAtom, public CInterface
+class jlib_decl AtomBase : public CInterfaceOf<IAtom>
 {
 public:
-    IMPLEMENT_IINTERFACE
-
     AtomBase(const void * k)  
     { 
         key = strdup((const char *)k);