dbertoni    02/04/17 21:51:50

  Modified:    c/src/XalanSourceTree XalanSourceTreeDocument.cpp
                        XalanSourceTreeDocument.hpp
  Log:
  New constructor for choosing node allocator block sizes.
  
  Revision  Changes    Path
  1.29      +44 -9     
xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp
  
  Index: XalanSourceTreeDocument.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- XalanSourceTreeDocument.cpp       6 Apr 2002 19:36:51 -0000       1.28
  +++ XalanSourceTreeDocument.cpp       18 Apr 2002 04:51:50 -0000      1.29
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -95,16 +95,51 @@
        XalanDocument(),
        m_firstChild(0),
        m_documentElement(0),
  -     m_attributeAllocator(200),
  -     m_attributeNSAllocator(50),
  -     m_commentAllocator(20),
  -     m_elementAllocator(200),
  -     m_elementNSAllocator(200),
  -     m_piAllocator(25),
  -     m_textAllocator(200),
  -     m_textIWSAllocator(400),
  +     m_attributeAllocator(eDefaultAttributeAllocatorBlockSize),
  +     m_attributeNSAllocator(eDefaultAttributeNSAllocatorBlockSize),
  +     m_commentAllocator(eDefaultCommentAllocatorBlockSize),
  +     m_elementAllocator(eDefaultElementAllocatorBlockSize),
  +     m_elementNSAllocator(eDefaultElementNSAllocatorBlockSize),
  +     m_piAllocator(eDefaultPIAllocatorBlockSize),
  +     m_textAllocator(eDefaultTextAllocatorBlockSize),
  +     m_textIWSAllocator(eDefaultTextIWSAllocatorBlockSize),
        m_namesStringPool(theNamesStringPoolBlockSize, 
theNamesStringPoolBucketCount, theNamesStringPoolBucketSize),
        m_valuesStringPool(theValuesStringPoolBlockSize, 
theValuesStringPoolBucketCount, theValuesStringPoolBucketSize),
  +     m_attributesVector(),
  +     m_nextIndexValue(2),
  +     m_poolAllText(fPoolAllText),
  +     m_elementsByID(),
  +     m_unparsedEntityURIs(),
  +     m_nonPooledStrings(),
  +     m_stringBuffer()
  +{
  +}
  +
  +
  +
  +XalanSourceTreeDocument::XalanSourceTreeDocument(
  +                     allocator_size_type             theAttributeBlockSize,
  +                     allocator_size_type             theAttributeNSBlockSize,
  +                     allocator_size_type             theCommentBlockSize,
  +                     allocator_size_type             theElementBlockSize,
  +                     allocator_size_type             theElementNSBlockSize,
  +                     allocator_size_type             thePIBlockSize,
  +                     allocator_size_type             theTextBlockSize,
  +                     allocator_size_type             theTextIWSBlockSize,
  +                     bool                                    fPoolAllText) :
  +     XalanDocument(),
  +     m_firstChild(0),
  +     m_documentElement(0),
  +     m_attributeAllocator(theAttributeBlockSize),
  +     m_attributeNSAllocator(theAttributeNSBlockSize),
  +     m_commentAllocator(theCommentBlockSize),
  +     m_elementAllocator(theElementBlockSize),
  +     m_elementNSAllocator(theElementNSBlockSize),
  +     m_piAllocator(thePIBlockSize),
  +     m_textAllocator(theTextBlockSize),
  +     m_textIWSAllocator(theTextIWSBlockSize),
  +     m_namesStringPool(eDefaultNamesStringPoolBlockSize, 
eDefaultNamesStringPoolBucketCount, eDefaultNamesStringPoolBucketSize),
  +     m_valuesStringPool(eDefaultValuesStringPoolBlockSize, 
eDefaultValuesStringPoolBucketCount, eDefaultValuesStringPoolBucketSize),
        m_attributesVector(),
        m_nextIndexValue(2),
        m_poolAllText(fPoolAllText),
  
  
  
  1.17      +39 -5     
xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp
  
  Index: XalanSourceTreeDocument.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XalanSourceTreeDocument.hpp       6 Apr 2002 19:36:51 -0000       1.16
  +++ XalanSourceTreeDocument.hpp       18 Apr 2002 04:51:50 -0000      1.17
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -142,7 +142,15 @@
        terminate();
   
   
  -     enum { eDefaultNamesStringPoolBlockSize = 
XalanDOMStringPool::eDefaultBlockSize,
  +     enum { eDefaultAttributeAllocatorBlockSize = 100,
  +                eDefaultAttributeNSAllocatorBlockSize = 50,
  +                eDefaultCommentAllocatorBlockSize = 10,
  +                eDefaultElementAllocatorBlockSize = 100,
  +                eDefaultElementNSAllocatorBlockSize = 100,
  +                eDefaultPIAllocatorBlockSize = 10,
  +                eDefaultTextAllocatorBlockSize = 100,
  +                eDefaultTextIWSAllocatorBlockSize = 100,
  +                eDefaultNamesStringPoolBlockSize = 
XalanDOMStringPool::eDefaultBlockSize,
                   eDefaultNamesStringPoolBucketCount = 
XalanDOMStringPool::eDefaultBucketCount,
                   eDefaultNamesStringPoolBucketSize = 
XalanDOMStringPool::eDefaultBucketSize,
                   eDefaultValuesStringPoolBlockSize = 
XalanDOMStringPool::eDefaultBlockSize,
  @@ -150,9 +158,10 @@
                   eDefaultValuesStringPoolBucketSize = 
XalanDOMStringPool::eDefaultBucketSize };
   
   
  -     typedef XalanDOMStringPool::block_size_type             block_size_type;
  -     typedef XalanDOMStringPool::bucket_count_type   bucket_count_type;
  -     typedef XalanDOMStringPool::bucket_size_type    bucket_size_type;
  +     typedef XalanSourceTreeAttributeAllocator::size_type    
allocator_size_type;
  +     typedef XalanDOMStringPool::block_size_type                             
block_size_type;
  +     typedef XalanDOMStringPool::bucket_count_type                   
bucket_count_type;
  +     typedef XalanDOMStringPool::bucket_size_type                    
bucket_size_type;
   
        /**
         *
  @@ -175,6 +184,31 @@
                        block_size_type         theValuesStringPoolBlockSize = 
eDefaultValuesStringPoolBlockSize,
                        bucket_count_type       theValuesStringPoolBucketCount 
= eDefaultValuesStringPoolBucketCount,
                        bucket_size_type        theValuesStringPoolBucketSize = 
eDefaultValuesStringPoolBucketSize);
  +
  +     /**
  +      *
  +      * Constructor for XalanSourceTreeDocument.
  +      *
  +      * @param theAttributeBlockSize The block size for allocating attribute 
nodes
  +      * @param theAttributeNSBlockSize The block size for allocating 
attribute NS nodes
  +      * @param theCommentBlockSize The block size for allocating comment 
nodes
  +      * @param theElementBlockSize The block size for allocating element 
nodes
  +      * @param theElementNSBlockSize The block size for allocating element 
nodes
  +      * @param theTextBlockSize The block size for allocating text nodes,
  +      * @param theTextIWSBlockSize The block size for allocating text IWS 
nodes,
  +      * @param fPoolAllText If false, text node data that is not whitespace 
will not be pooled.
  +      *
  +      */
  +     XalanSourceTreeDocument(
  +                     allocator_size_type             theAttributeBlockSize,
  +                     allocator_size_type             theAttributeNSBlockSize,
  +                     allocator_size_type             theCommentBlockSize,
  +                     allocator_size_type             theElementBlockSize,
  +                     allocator_size_type             theElementNSBlockSize,
  +                     allocator_size_type             thePIBlockSize,
  +                     allocator_size_type             theTextBlockSize,
  +                     allocator_size_type             theTextIWSBlockSize,
  +                     bool                                    fPoolAllText = 
true);
   
        virtual
        ~XalanSourceTreeDocument();
  
  
  

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

Reply via email to