This is Unofficial EPICS BASE Doxygen Site
osdPoolStatus.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE Versions 3.13.7
7 * and higher are distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 #include <rtems/malloc.h>
11 
12 #include "osiPoolStatus.h"
13 
14 /*
15  * osiSufficentSpaceInPool ()
16  */
17 LIBCOM_API int epicsStdCall osiSufficentSpaceInPool ( size_t contiguousBlockSize )
18 {
19  rtems_malloc_statistics_t s;
20  unsigned long n;
21 
22  malloc_get_statistics(&s);
23  n = s.space_available - (unsigned long)(s.lifetime_allocated - s.lifetime_freed);
24  return (n > (50000 + contiguousBlockSize));
25 }
Functions to check the state of the system memory pool.
LIBCOM_API int epicsStdCall osiSufficentSpaceInPool(size_t contiguousBlockSize)
Checks if a memory block of a specific size can be safely allocated.
Definition: osdPoolStatus.c:19