mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Update.
2000-06-28 Wolfram Gloger <wg@malloc.de> * malloc/malloc.c (chunk_alloc): If extension of the linear heap fails, try mmap_chunk() as a last resort even though n_mmaps_max may have been reached.
This commit is contained in:
parent
5295113f8f
commit
07c35131ad
@ -1,3 +1,9 @@
|
||||
2000-06-28 Wolfram Gloger <wg@malloc.de>
|
||||
|
||||
* malloc/malloc.c (chunk_alloc): If extension of the linear heap
|
||||
fails, try mmap_chunk() as a last resort even though n_mmaps_max
|
||||
may have been reached.
|
||||
|
||||
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locale/programs/ld-collate.c (insert_weights): Handle <Uxxxx>
|
||||
|
@ -1,5 +1,8 @@
|
||||
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locales/cs_CZ: Updated for new format.
|
||||
Patch by Jakub Jelinek <jakub@redhat.com>.
|
||||
|
||||
* tests-mbwc/dat_mbrlen.c: Correct some tests. Remove old WAIVER
|
||||
comments.
|
||||
* tests-mbwc/tst_mbrlen.c: Enable code to respect t_ini. Also clear
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,9 +25,23 @@ comment_char %
|
||||
% Copyright (C) 1999 Theppitak Karoonboonyanan, National Electronics and
|
||||
% Computer Technology Center (NECTEC).
|
||||
%
|
||||
% Use and distribution of this data is hereby granted for any purpose,
|
||||
% including commercial use, provided it is unaltered. Queries on use and
|
||||
% content should be made to the above address.
|
||||
% Permission is hereby granted, free of charge, to any person obtaining
|
||||
% a copy of this software and associated documentation files (the "Software"),
|
||||
% to deal in the Software without restriction, including without limitation
|
||||
% the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
% and/or sell copies of the Software, and to permit persons to whom the
|
||||
% Software is furnished to do so, subject to the following conditions:
|
||||
%
|
||||
% The above copyright notice and this permission notice shall be included
|
||||
% in all copies or substantial portions of the Software.
|
||||
%
|
||||
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
% OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
% ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
% OTHER DEALINGS IN THE SOFTWARE.
|
||||
%
|
||||
|
||||
LC_CTYPE
|
||||
|
@ -1872,8 +1872,6 @@ mmap_chunk(size) size_t size;
|
||||
size_t page_mask = malloc_getpagesize - 1;
|
||||
mchunkptr p;
|
||||
|
||||
if(n_mmaps >= n_mmaps_max) return 0; /* too many regions */
|
||||
|
||||
/* For mmapped chunks, the overhead is one SIZE_SZ unit larger, because
|
||||
* there is no following chunk whose prev_size field could be used.
|
||||
*/
|
||||
@ -2930,8 +2928,10 @@ chunk_alloc(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
{
|
||||
|
||||
#if HAVE_MMAP
|
||||
/* If big and would otherwise need to extend, try to use mmap instead */
|
||||
/* If the request is big and there are not yet too many regions,
|
||||
and we would otherwise need to extend, try to use mmap instead. */
|
||||
if ((unsigned long)nb >= (unsigned long)mmap_threshold &&
|
||||
n_mmaps < n_mmaps_max &&
|
||||
(victim = mmap_chunk(nb)) != 0)
|
||||
return victim;
|
||||
#endif
|
||||
@ -2939,7 +2939,15 @@ chunk_alloc(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
/* Try to extend */
|
||||
malloc_extend_top(ar_ptr, nb);
|
||||
if ((remainder_size = chunksize(top(ar_ptr)) - nb) < (long)MINSIZE)
|
||||
{
|
||||
#if HAVE_MMAP
|
||||
/* A last attempt: when we are out of address space in the arena,
|
||||
try mmap anyway, disregarding n_mmaps_max. */
|
||||
if((victim = mmap_chunk(nb)) != 0)
|
||||
return victim;
|
||||
#endif
|
||||
return 0; /* propagate failure */
|
||||
}
|
||||
}
|
||||
|
||||
victim = top(ar_ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user