mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* malloc/malloc.c (_int_malloc): Limit number of unsorted blocks
to sort in each call.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2006-08-19 Ulrich Drepper <drepper@redhat.com>
|
2006-08-19 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* malloc/malloc.c (_int_malloc): Limit number of unsorted blocks
|
||||||
|
to sort in each call.
|
||||||
|
|
||||||
* nis/nss_nis/nis-service.c (internal_nis_getservent_r): . If map
|
* nis/nss_nis/nis-service.c (internal_nis_getservent_r): . If map
|
||||||
is empty simply return and use next service.
|
is empty simply return and use next service.
|
||||||
* nis/nss_nis/nis-rpc.c (internal_nis_getrpcent_r): Likewise.
|
* nis/nss_nis/nis-rpc.c (internal_nis_getrpcent_r): Likewise.
|
||||||
|
@ -4055,6 +4055,8 @@ _int_malloc(mstate av, size_t bytes)
|
|||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
||||||
|
int iters = 0;
|
||||||
|
bool any_larger = false;
|
||||||
while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
|
while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
|
||||||
bck = victim->bk;
|
bck = victim->bk;
|
||||||
if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
|
if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
|
||||||
@ -4145,6 +4147,12 @@ _int_malloc(mstate av, size_t bytes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size >= nb)
|
||||||
|
any_larger = true;
|
||||||
|
#define MAX_ITERS 10000
|
||||||
|
if (++iters == MAX_ITERS)
|
||||||
|
break;
|
||||||
|
|
||||||
mark_bin(av, victim_index);
|
mark_bin(av, victim_index);
|
||||||
victim->bk = bck;
|
victim->bk = bck;
|
||||||
victim->fd = fwd;
|
victim->fd = fwd;
|
||||||
|
Reference in New Issue
Block a user