/[pupa]/pupa/kern/mm.c
ViewVC logotype

Diff of /pupa/kern/mm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by okuji, Fri Dec 27 08:53:09 2002 UTC revision 1.2 by okuji, Mon Jan 6 00:01:35 2003 UTC
# Line 195  pupa_memalign (pupa_size_t align, pupa_s Line 195  pupa_memalign (pupa_size_t align, pupa_s
195  {  {
196    pupa_mm_region_t r;    pupa_mm_region_t r;
197    pupa_size_t n = ((size + PUPA_MM_ALIGN - 1) >> PUPA_MM_ALIGN_LOG2) + 1;    pupa_size_t n = ((size + PUPA_MM_ALIGN - 1) >> PUPA_MM_ALIGN_LOG2) + 1;
198    int first = 1;    int count = 0;
199        
200    align = (align >> PUPA_MM_ALIGN_LOG2);    align = (align >> PUPA_MM_ALIGN_LOG2);
201    if (align == 0)    if (align == 0)
# Line 212  pupa_memalign (pupa_size_t align, pupa_s Line 212  pupa_memalign (pupa_size_t align, pupa_s
212          return p;          return p;
213      }      }
214    
215    /* If failed, invalidate disk caches to increase free memory.  */    /* If failed, increase free memory somehow.  */
216    if (first)    switch (count)
217      {      {
218        case 0:
219          /* Invalidate disk caches.  */
220        pupa_disk_cache_invalidate_all ();        pupa_disk_cache_invalidate_all ();
221        first = 0;        count++;
222          goto again;
223          
224        case 1:
225          /* Unload unneeded modules.  */
226          pupa_dl_unload_unneeded ();
227          count++;
228        goto again;        goto again;
     }  
229    
230        default:
231          break;
232        }
233      
234    pupa_error (PUPA_ERR_OUT_OF_MEMORY, "out of memory");    pupa_error (PUPA_ERR_OUT_OF_MEMORY, "out of memory");
235    return 0;    return 0;
236  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26