Lines 1-5
Link Here
|
1 |
/* Minimal replacements for basic facilities used in the dynamic linker. |
1 |
/* Minimal replacements for basic facilities used in the dynamic linker. |
2 |
Copyright (C) 1995-1998,2000-2002,2004,2005 Free Software Foundation, Inc. |
2 |
Copyright (C) 1995-1998,2000-2002,2004,2005,2006 |
|
|
3 |
Free Software Foundation, Inc. |
3 |
This file is part of the GNU C Library. |
4 |
This file is part of the GNU C Library. |
4 |
|
5 |
|
5 |
The GNU C Library is free software; you can redistribute it and/or |
6 |
The GNU C Library is free software; you can redistribute it and/or |
Lines 128-141
Link Here
|
128 |
void * weak_function |
129 |
void * weak_function |
129 |
realloc (void *ptr, size_t n) |
130 |
realloc (void *ptr, size_t n) |
130 |
{ |
131 |
{ |
131 |
void *new; |
|
|
132 |
if (ptr == NULL) |
132 |
if (ptr == NULL) |
133 |
return malloc (n); |
133 |
return malloc (n); |
134 |
assert (ptr == alloc_last_block); |
134 |
assert (ptr == alloc_last_block); |
|
|
135 |
size_t old_size = alloc_ptr - alloc_last_block; |
135 |
alloc_ptr = alloc_last_block; |
136 |
alloc_ptr = alloc_last_block; |
136 |
new = malloc (n); |
137 |
void *new = malloc (n); |
137 |
assert (new == ptr); |
138 |
return new != ptr ? memcpy (new, ptr, old_size) : new; |
138 |
return new; |
|
|
139 |
} |
139 |
} |
140 |
/* Avoid signal frobnication in setjmp/longjmp. Keeps things smaller. */ |
140 |
/* Avoid signal frobnication in setjmp/longjmp. Keeps things smaller. */ |