comparison src/gmalloc.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 441bb1e64a06
children 1ce6082ce73f
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
256 /* If not NULL, this function is called after each time 256 /* If not NULL, this function is called after each time
257 `__morecore' is called to increase the data size. */ 257 `__morecore' is called to increase the data size. */
258 extern void (*__after_morecore_hook) __P ((void)); 258 extern void (*__after_morecore_hook) __P ((void));
259 259
260 /* Nonzero if `malloc' has been called and done its initialization. */ 260 /* Nonzero if `malloc' has been called and done its initialization. */
261 /* extern int __malloc_initialized; */ 261 extern int __malloc_initialized;
262 262
263 /* Hooks for debugging versions. */ 263 /* Hooks for debugging versions. */
264 extern void (*__free_hook) __P ((__ptr_t __ptr)); 264 extern void (*__free_hook) __P ((__ptr_t __ptr));
265 extern __ptr_t (*__malloc_hook) __P ((size_t __size)); 265 extern __ptr_t (*__malloc_hook) __P ((size_t __size));
266 extern __ptr_t (*__realloc_hook) __P ((__ptr_t __ptr, size_t __size)); 266 extern __ptr_t (*__realloc_hook) __P ((__ptr_t __ptr, size_t __size));
349 or (US mail) as Mike Haertel c/o Free Software Foundation, Inc. */ 349 or (US mail) as Mike Haertel c/o Free Software Foundation, Inc. */
350 350
351 #if defined (__GNU_LIBRARY__) || defined (_LIBC) 351 #if defined (__GNU_LIBRARY__) || defined (_LIBC)
352 #include <stddef.h> 352 #include <stddef.h>
353 #include <sys/cdefs.h> 353 #include <sys/cdefs.h>
354 #if ! (defined (__GLIBC__) && (__GLIBC__ >= 2))
355 extern size_t __getpagesize __P ((void)); 354 extern size_t __getpagesize __P ((void));
356 #endif
357 #else 355 #else
358 #include "getpagesize.h" 356 #include "getpagesize.h"
359 #define __getpagesize() getpagesize() 357 #define __getpagesize() getpagesize()
360 #endif 358 #endif
361 359
431 __malloc_size_t _bytes_used; 429 __malloc_size_t _bytes_used;
432 __malloc_size_t _chunks_free; 430 __malloc_size_t _chunks_free;
433 __malloc_size_t _bytes_free; 431 __malloc_size_t _bytes_free;
434 432
435 /* Are you experienced? */ 433 /* Are you experienced? */
436 static int __malloc_initialized; 434 int __malloc_initialized;
437 435
438 void (*__after_morecore_hook) __P ((void)); 436 void (*__after_morecore_hook) __P ((void));
439 437
440 /* Aligned allocation. */ 438 /* Aligned allocation. */
441 static __ptr_t align __P ((__malloc_size_t)); 439 static __ptr_t align __P ((__malloc_size_t));
1297 extern __ptr_t __sbrk __P ((ssize_t increment)); 1295 extern __ptr_t __sbrk __P ((ssize_t increment));
1298 #else 1296 #else
1299 #ifdef __GNU_LIBRARY__ 1297 #ifdef __GNU_LIBRARY__
1300 /* It is best not to declare this and cast its result on foreign operating 1298 /* It is best not to declare this and cast its result on foreign operating
1301 systems with potentially hostile include files. */ 1299 systems with potentially hostile include files. */
1302 #if !(defined(linux) && defined(sparc))
1303 extern __ptr_t __sbrk __P ((int increment)); 1300 extern __ptr_t __sbrk __P ((int increment));
1304 #endif
1305 #endif 1301 #endif
1306 #endif 1302 #endif
1307 1303
1308 #ifndef NULL 1304 #ifndef NULL
1309 #define NULL 0 1305 #define NULL 0