Back to index

glibc  2.9
memusage.h
Go to the documentation of this file.
00001 /* Copyright (C) 2000, 2005 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 
00020 #include <limits.h>
00021 #include <atomic.h>
00022 
00023 #ifndef GETSP
00024 # warning "GETSP is not defined for this architecture."
00025 # define GETSP 0
00026 #endif
00027 
00028 #ifndef GETTIME
00029 # define GETTIME(low,high) \
00030   {                                                                  \
00031     struct timeval tval;                                             \
00032     uint64_t usecs;                                                  \
00033     gettimeofday (&tval, NULL);                                             \
00034     usecs = (uint64_t) tval.tv_usec + (uint64_t) tval.tv_usec * 1000000;      \
00035     low = usecs & 0xffffffff;                                               \
00036     high = usecs >> 32;                                                     \
00037   }
00038 #endif
00039 
00040 #if LONG_BIT == 32
00041 # define memusage_cntr_t uatomic32_t
00042 #else
00043 # define memusage_cntr_t uatomic64_t
00044 #endif
00045 #ifndef memusage_size_t
00046 # if LONG_BIT == 32
00047 #  define memusage_size_t uatomic32_t
00048 # else
00049 #  define memusage_size_t uatomic64_t
00050 # endif
00051 #endif