You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Marc <ma...@ist.de> on 2000/02/16 11:37:09 UTC

xml4c3_0_0 questions

Hi


1. "new"
On my machine

// Original
void* XMLPlatformUtils::makeMutex()
{
    pthread_mutex_t* mutex = new pthread_mutex_t;
    pthread_mutexattr_t*  attr = new
pthread_mutexattr_t;
    pthread_mutexattr_init(attr);

    pthread_mutexattr_settype(attr,
PTHREAD_MUTEX_RECURSIVE);
    if (pthread_mutex_init(mutex, attr))
    {
        ThrowXML(XMLPlatformUtilsException,

XML4CExcepts::Mutex_CouldNotCreate);
    }
    pthread_mutexattr_destroy(attr);
    delete attr;
    return (void*)(mutex);
}

takes twice as long as does

// Changed
void* XMLPlatformUtils::makeMutex()
{
    pthread_mutex_t *mutex  = new pthread_mutex_t;

    pthread_mutexattr_t  attr;
    pthread_mutexattr_init(&attr);

    pthread_mutexattr_settype(&attr,
PTHREAD_MUTEX_RECURSIVE);
    if (pthread_mutex_init(mutex, &attr))
    {
        ThrowXML(XMLPlatformUtilsException,

XML4CExcepts::Mutex_CouldNotCreate);
    }

    pthread_mutexattr_destroy(&attr);
    return (void *)(mutex);
}

/src/ contains 107 files in which new is being
called.
I've seen various places where local variables are

put on the heap, so maybe there is opportunity for

improvement.
If you think this would be worth doing (I have no
profiling data), I'd volunteer...


2. Would it be ok to use the STL if I were to
change the source code? I.e. what is
your strategy regarding C++ backward
compatibility?


3. There is one problem. I built libxerces-c1_0.so
with these options:

-p irix -c cc -x CC -m inmem -n fileonly -t native

Parsing my test-project results in

Fatal Error in file
"/usr/people/marc/projects/xml/EPKO.xml", line 1,
column 48
   Message: An exception occured!
Type:RuntimeException, Message:Could not create a
converter for encoding: iso-8859-1

What's amiss?


Thanks



--
marc

---------------------------------------------------------------
marc stuessel                   mailto:marc@ist.de
IST GmbH
P.O. Box 11 12 29               Fax:   ++49 (0) 721 / 831 32 33
76062 Karlsruhe                 Phone: ++49 (0) 721 / 831 32-0
Germany                         GSM:   ++49 (0) 177 / 831 32 10