vmalloc.h revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#ifndef _VMALLOC_H
#define _VMALLOC_H 1
/* Public header file for the virtual malloc package.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/1994.
*/
#define VMALLOC_VERSION 20110808L
#if _PACKAGE_ast
#include <ast_std.h>
#else
#include <ast_common.h>
#endif
typedef struct _vmalloc_s Vmalloc_t;
typedef struct _vmethod_s Vmethod_t;
struct _vmstat_s
{ int n_busy; /* number of busy blocks */
int n_free; /* number of free blocks */
int n_seg; /* number of segments */
int n_region; /* #parallel regions (Vmregion) */
int n_open; /* #calls that finds open reg */
int n_lock; /* #calls where reg was locked */
int n_probe; /* #probes to find a region */
int mode; /* region mode bits */
};
struct _vmdisc_s
};
struct _vmethod_s
unsigned short meth;
};
struct _vmalloc_s
char* file; /* file name */
int line; /* line number */
char* func; /* calling function */
};
#define VM_TRUST 0000000 /* obsolete */
/* exception types */
/* for application-specific data in shared/persistent regions */
#define VM_MMGET 0 /* get data value (void*) */
_BEGIN_EXTERNS_ /* public data */
#if _BLD_vmalloc && defined(__EXPORT__)
#define extern extern __EXPORT__
#endif
#if !_BLD_vmalloc && defined(__IMPORT__)
#define extern extern __IMPORT__
#endif
#undef extern
_BEGIN_EXTERNS_ /* public functions */
#if _BLD_vmalloc && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#if !defined(_BLD_vmalloc) && !defined(_AST_STD_H) && \
!defined(__stdlib_h) && !defined(__STDLIB_H) && \
!defined(_STDLIB_INCLUDED) && !defined(_INC_STDLIB)
#endif
#undef extern
/* to coerce any value to a Vmalloc_t*, make ANSI happy */
/* enable recording of where a call originates from */
#ifdef VMFL
#if defined(__FILE__)
#else
#endif
#if defined(__LINE__)
#else
#endif
#if defined(__FUNCTION__)
#else
#endif
#if _map_malloc
#else
#if !_std_malloc
#ifndef strdup
#endif
#else
((size_t)(s)) )
((size_t)(s) )
#ifndef strdup
((char*)(s)) )
#endif
#endif /*__STD_C || defined(__STDPP__) || defined(__GNUC__)*/
#endif /*!_std_malloc*/
#endif /*_map_malloc*/
#endif /*VMFL*/
/* non-debugging/profiling allocation calls */
#ifndef vmalloc
#endif
#ifndef vmresize
#endif
#ifndef vmfree
#endif
#ifndef vmalign
#endif
(VM_RSMOVE) )
#endif /* _VMALLOC_H */