OpenRadioss
2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
BI_UpdateBuffs.c File Reference
#include "
Bdef.h
"
Go to the source code of this file.
Functions
void
BI_UpdateBuffs
(
BLACBUFF
*Newbp)
Function Documentation
◆
BI_UpdateBuffs()
void BI_UpdateBuffs
(
BLACBUFF
*
Newbp
)
Definition at line
3
of file
BI_UpdateBuffs.c
.
4
{
5
Int
BI_BuffIsFree
(
BLACBUFF
*,
Int
);
6
BLACBUFF
*bp, *bp2;
7
extern
BLACBUFF
*
BI_ReadyB
, *
BI_ActiveQ
;
8
9
if
(Newbp)
10
{
11
if
(
BI_ActiveQ
== NULL)
BI_ActiveQ
= Newbp->
prev
= Newbp;
12
else
13
{
14
BI_ActiveQ
->prev->next = Newbp;
15
Newbp->
prev
=
BI_ActiveQ
->prev;
16
BI_ActiveQ
->prev = Newbp;
17
}
18
Newbp->
next
= NULL;
19
if
(Newbp ==
BI_ReadyB
)
BI_ReadyB
= NULL;
20
}
21
/*
22
* See if any active buffers are ready for reuse.
23
*/
24
for
(bp=
BI_ActiveQ
; bp != NULL; bp = bp2)
25
{
26
bp2 = bp->
next
;
27
if
(
BI_BuffIsFree
(bp, 0) )
/* if all of buff's Aops are done */
28
{
29
/*
30
* Remove bp from BI_ActiveQ -- update pointers
31
*/
32
if
(bp->
next
) bp->
next
->
prev
= bp->
prev
;
33
else
BI_ActiveQ
->prev = bp->
prev
;
34
if
(bp !=
BI_ActiveQ
) bp->
prev
->
next
= bp->
next
;
35
else
BI_ActiveQ
=
BI_ActiveQ
->next;
36
37
/*
38
* If no ready buffer, inactive buff becomes ready
39
*/
40
if
(
BI_ReadyB
== NULL)
BI_ReadyB
= bp;
41
/*
42
* If inactive buff bigger than present ready buff, release ready,
43
* and inactive buff becomes ready
44
*/
45
else
if
(
BI_ReadyB
->Len < bp->
Len
)
46
{
47
free(
BI_ReadyB
);
48
BI_ReadyB
= bp;
49
}
50
/*
51
* If ready buffer exists and is bigger than inactive buff,
52
* free inactive buff
53
*/
54
else
free(bp);
55
}
56
}
57
}
/* end BI_UpdateBuffs */
BI_BuffIsFree
Int BI_BuffIsFree(BLACBUFF *bp, Int Wait)
Definition
BI_BuffIsFree.c:3
BI_ReadyB
BLACBUFF * BI_ReadyB
Definition
BI_GlobalVars.c:8
BI_ActiveQ
BLACBUFF * BI_ActiveQ
Definition
BI_GlobalVars.c:9
Int
#define Int
Definition
Bconfig.h:22
BLACBUFF
struct bLaCbUfF BLACBUFF
Definition
Bdef.h:53
bLaCbUfF::Len
Int Len
Definition
Bdef.h:57
bLaCbUfF::prev
BLACBUFF * prev
Definition
Bdef.h:62
bLaCbUfF::next
BLACBUFF * next
Definition
Bdef.h:62
engine
extlib
scalapack-2.2.0
BLACS
SRC
BI_UpdateBuffs.c
Generated by
1.15.0