StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
RTS
include
SECTOR
fixAlloc.hh
1
#ifndef _FIX_ALLOC_HH_
2
#define _FIX_ALLOC_HH_
3
4
#include <semLib.h>
5
6
#define FIX_ALLOC_TMOUT 1000 // 10 seconds...
7
8
class
fixAlloc
9
{
10
public
:
11
fixAlloc
(
char
*wh,
int
bnum,
int
bytes) ;
12
~
fixAlloc
() ;
13
14
void
resize(
char
*wh,
int
bnum,
int
bytes) ;
15
16
char
*alloc(
int
bytes,
int
block=1) ;
17
int
free(
void
*wh) ;
18
void
clear(
void
) ;
19
void
shrink(
void
*wh,
int
real) ;
20
int
check(
void
*wh) ;
21
int
getblk(
void
*wh) ;
22
23
int
take_mutex(
void
) {
return
semTake(semutex,FIX_ALLOC_TMOUT) ; } ;
24
int
take_semfree(
void
) {
return
semTake(semfree,FIX_ALLOC_TMOUT) ; } ;
25
int
give_mutex(
void
) {
return
semGive(semutex) ; } ;
26
int
give_semfree(
void
) {
return
semGive(semfree) ; } ;
27
int
alloced ;
// for debugging
28
29
int
blbytes ;
30
int
blnum ;
31
private
:
32
char
*where ;
33
int
myalloc ;
34
int
cleared ;
35
int
*desc ;
// storage for states
36
37
int
last_free ;
38
int
last_free_blks ;
39
40
SEM_ID semutex ;
41
SEM_ID semfree ;
42
43
} ;
44
45
46
#endif
fixAlloc
Definition:
fixAlloc.hh:8
Generated by
1.8.5