[ 
http://issues.apache.org/jira/browse/XERCESC-1358?page=comments#action_59758 ]
     
Gareth Reakes commented on XERCESC-1358:
----------------------------------------

I committed that patch David. For your next problem, is there any nice way of 
finding the nearest prime? I know its not possible except through brute force, 
but would most of the time do. For example, I found this

In each 30 integers, for N >= 1, the numbers that might be prime are
N*30+1,
N*30+7,
N*30+11,
N*30+13,
N*30+17,
N*30+19,
N*30+23,
N*30+29 


how often does that hold? Could we just ensure the next number is divisable by 
30 and add 1 and say thats OK most of the time? Otherwise we could populate a 
structure with some primes during startup. How big is the table likely to get?

> RefHashTableOf::rehash() is not exception-safe
> ----------------------------------------------
>
>          Key: XERCESC-1358
>          URL: http://issues.apache.org/jira/browse/XERCESC-1358
>      Project: Xerces-C++
>         Type: Bug
>   Components: Utilities
>     Versions: 2.6.0
>  Environment: All
>     Reporter: David Bertoni
>     Assignee: Gareth Reakes
>  Attachments: patch.txt
>
> RefHashTableOf::rehash() modifies its data member in the course of rehashing. 
>  If an exception is thrown during this member function, the object is in an 
> inconsistent state, which will cause problems when it is destroyed.  Also, 
> there is a chance that memory will leak.
> I will provide a patch which does not modify the data members until the 
> rehashing has complete.  It also fixes the potential memory leak.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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

Reply via email to