home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / pippy-0.6beta-src.tar.gz / pippy-0.6beta-src.tar / pippy-0.6beta-src / src / Palm / libc / malloc.c < prev    next >
C/C++ Source or Header  |  2000-12-21  |  355b  |  18 lines

  1. #include <stdlib.h>
  2. #include <PalmOS.h>
  3. #include <PalmCompatibility.h>
  4. #include "libc_segments.h"
  5.  
  6. long malloc_ref_count = 0;
  7. void *malloc( size_t size ) {
  8.     void *mem = MemPtrNew(size);
  9.     if (mem!=NULL) malloc_ref_count++;
  10.     return mem;
  11. }
  12.  
  13. long get_malloc_ref_count() SEG_LIBC;
  14. long get_malloc_ref_count() {
  15.     /* for debugging */
  16.     return malloc_ref_count;
  17. }
  18.