richter     00/12/12 23:54:07

  Modified:    .        Tag: Embperl2c epdom.c
  Log:
  Embperl2
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.14  +22 -10    embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.13
  retrieving revision 1.4.2.14
  diff -u -r1.4.2.13 -r1.4.2.14
  --- epdom.c   2000/12/13 06:54:36     1.4.2.13
  +++ epdom.c   2000/12/13 07:54:06     1.4.2.14
  @@ -30,6 +30,7 @@
   int numAttr   = 0 ;
   int numStr    = 0 ;
   int numPads   = 0 ;
  +int numReplace   = 0 ;
   
   tIndex xNoName  = 0 ;
   tIndex xDomTreeAttr = 0 ;
  @@ -59,7 +60,7 @@
   void * dom_realloc (void * s, size_t  n)
       {
       void * m = ((size_t *)s) - 1 ;
  -    nMemUsage -= *((size_t *)s) ;
  +    nMemUsage -= *((size_t *)m) ;
       if (m = realloc (m, n + sizeof (size_t)))
        {
        nMemUsage += n ;
  @@ -560,7 +561,7 @@
   void DomStats (void)
   
       {
  -    lprintf (pCurrReq, "[%d]PERF: DOMSTAT: MemUsage = %d Bytes  numNodes = %d  
numPad = %d  numStr = %d\n", pCurrReq -> nPid, nMemUsage, numNodes, numPads, numStr) ;
  +    lprintf (pCurrReq, "[%d]PERF: DOMSTAT: MemUsage = %d Bytes  numNodes = %d  
numStr = %d  numReplace = %d  \n", pCurrReq -> nPid, nMemUsage, numNodes,  numStr, 
numReplace) ;
       }
   
   /* ------------------------------------------------------------------------ */
  @@ -1029,6 +1030,7 @@
       pNewChild -> xNdx    = xNdx ;
       pNewChild -> nLinenumber = nLinenumber ;
       pNewChild -> bFlags = nflgOK ;
  +    pNewChild -> xDomTree = pDomTree -> xNdx ;
   
       if (xChilds)
           { /* --- attribute has already childs, get the first and last one --- */
  @@ -1353,12 +1355,16 @@
       {
       int              len  = sizeof (tNodeData) + (bDeep == -1?0:pNode -> numAttr * 
sizeof (tAttrData)) ; 
       tNode       xNewNode ;
  +    tNodeData * pNew ;
   
  -    tNodeData * pNew = Node_newAndAppend (pDomTree, pNode -> xParent, NULL, 0, len) 
;
  +    if ((pNew = dom_malloc (len)) == NULL)
  +     return NULL ;
  +
  +    numNodes++ ;
       
       memcpy (pNew, pNode, len) ;
  -    xNewNode = ArrayAdd (&pDomTree -> pLookup, 1) ;
  -    pDomTree -> pLookup[xNewNode] = pNew ;
  +    xNewNode         = ArrayAdd (&pDomTree -> pLookup, 1) ;
  +    pDomTree -> pLookup[xNewNode]    = pNew ;
       pNew -> xNdx     = xNewNode ;
   
       if (pNew -> nText)
  @@ -1424,18 +1430,22 @@
       tNodeData * pNew ;
       tAttrData * pAttr ;
       int         n ;
  -   
  +    void * *    pLookup  ;
  +    tNode    xNdx ;
       
       if (pNode -> xDomTree == pDomTree -> xNdx)
           return pNode ;
   
  +    pLookup = pDomTree -> pLookup ;
  +    len          = sizeof (tNodeData) + pNode -> numAttr * sizeof (tAttrData) ; 
  +    xNdx    = pNode -> xNdx ;
   
  -    len  = sizeof (tNodeData) + pNode -> numAttr * sizeof (tAttrData) ; 
  +    if ((pLookup[xNdx] = pNew = dom_malloc (len)) == NULL)
  +     return NULL ;
   
  -    pNew = Node_newAndAppend (pDomTree, pNode -> xParent, NULL, 0, len) ;
  +    numNodes++ ;
       
       memcpy (pNew, pNode, len) ;
  -    pDomTree -> pLookup[pNode -> xNdx] = pNew ;
   
       if (pNew -> nText)
        NdxStringRefcntInc (pNew -> nText) ;
  @@ -1445,7 +1455,7 @@
   
       while (n)
        {
  -     pDomTree -> pLookup[pAttr -> xNdx] = pAttr ;
  +     pLookup[pAttr -> xNdx] = pAttr ;
        if (pAttr -> xName)
            NdxStringRefcntInc (pAttr -> xName) ;
        if (pAttr -> xValue && (pAttr -> bFlags & aflgAttrValue))
  @@ -1592,6 +1602,8 @@
       tNode    xOrgChild  = xOldChild ;
       tStringIndex n ;
       
  +    numReplace++ ;
  +
       /* *** lprintf (pCurrReq, "rp1--> SVs=%d  %s  DomTree Old=%d\n", sv_count, 
sText?sText:"<null>", Node_selfDomTree (Node_self (pDomTree, xOldChild))) ; */
   
       pOldChild  = Node_selfCondCloneNode (pDomTree, Node_self (pDomTree, xOldChild)) 
; 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to