#5278: [with code snippet, needs testing] On modern fedora 64 installs, sage
exists frequently when omalloc thinks there is no memory left
---------------------+------------------------------------------------------
 Reporter:  was      |       Owner:  cwitty  
     Type:  defect   |      Status:  new     
 Priority:  blocker  |   Milestone:  sage-3.3
Component:  misc     |    Keywords:          
---------------------+------------------------------------------------------

Comment(by GeorgSWeber):

 There is even this evil doing:
 {{{
 #define malloc  mALLOc
 }}}
 Anyway, I have an idea I'd like to test, but using the time shift, you in
 America might be faster. It's replacing the lines 1371-1374 of the file
 "omMalloc.c" (that seems to be the one of three almost identical files
 that is actually compiled):
 {{{
     /* Try to extend */
     malloc_extend_top(nb);
     if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE)
       return 0; /* propagate failure */
 }}}
 with the following lines of code:
 {{{
     /* Try to extend */
     malloc_extend_top(nb);
     if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE)
     {
 #if HAVE_MMAP
       /* On failure try to use mmap (again, or if small: for the first
 time!) */
       if ((victim = mmap_chunk(nb)) != 0)
       {
         return chunk2mem(victim);
       }
 #endif
       return 0; /* propagate failure */
     }
 }}}
 Unfortunately, I didn't find it easy to provide a "real" patch via
 hg/diff.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5278#comment:8>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to