~ubuntu-branches/ubuntu/natty/spring/natty

« back to all changes in this revision

Viewing changes to rts/System/Sync/bget.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-09-23 18:56:03 UTC
  • mfrom: (3.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100923185603-st97s5chplo42y7w
Tags: 0.82.5.1+dfsg1-1ubuntu1
* Latest upstream version for online play
* debian/control: Replace (rather than conflict) spring-engine
  - spring-engine will be a dummy package (LP: #612905)
  - also set maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
 
2
 
1
3
/*
2
 
 
3
 
    Interface definitions for bget.c, the memory management package.
4
 
 
5
 
*/
 
4
 * the memory management package.
 
5
 */
 
6
 
6
7
typedef long bufsize;
7
8
 
8
9
struct qlinks {
9
 
        struct bfhead *flink;         /* Forward link */
10
 
        struct bfhead *blink;         /* Backward link */
 
10
        struct bfhead *flink;      ///< Forward link
 
11
        struct bfhead *blink;      ///< Backward link
11
12
};
12
13
 
13
 
/* Header in allocated and free buffers */
14
 
 
 
14
/** Header in allocated and free buffers */
15
15
struct bhead {
16
 
        bufsize prevfree;                     /* Relative link back to previous
17
 
                                                                                                                free buffer in memory or 0 if
18
 
                                                                                                                previous buffer is allocated.   */
19
 
        bufsize bsize;                /* Buffer size: positive if free,
20
 
                                                                                                        negative if allocated. */
 
16
        /**
 
17
         * Relative link back to previous free buffer in memory or 0,
 
18
         * if previous buffer is allocated.
 
19
         */
 
20
        bufsize prevfree;
 
21
        /** Buffer size: positive if free, negative if allocated. */
 
22
        bufsize bsize;
21
23
};
22
24
#define BH(p)   ((struct bhead *) (p))
23
25
 
24
 
/*  Header in directly allocated buffers (by acqfcn) */
25
 
 
 
26
/** Header in directly allocated buffers (by acqfcn) */
26
27
struct bdhead {
27
 
        bufsize tsize;                /* Total size, including overhead */
28
 
        struct bhead bh;                      /* Common header */
 
28
        bufsize tsize;             ///< Total size, including overhead
 
29
        struct bhead bh;           ///< Common header
29
30
};
30
31
#define BDH(p)  ((struct bdhead *) (p))
31
32
 
32
 
/* Header in free buffers */
 
33
/** Header in free buffers */
33
34
 
34
35
struct bfhead {
35
 
        struct bhead bh;                      /* Common allocated/free header */
36
 
        struct qlinks ql;                     /* Links on free list */
 
36
        struct bhead bh;           ///< Common allocated/free header
 
37
        struct qlinks ql;          ///< Links on free list
37
38
};
38
39
#define BFH(p)  ((struct bfhead *) (p))
39
40
 
42
43
{
43
44
public:
44
45
        BGet();
 
46
        /** List of free buffers */
45
47
        struct bfhead freelist;/* = {
46
48
                                                                                                 {0, 0},
47
49
                                                                                                 {&freelist, &freelist}
48
 
        };*/     /* List of free buffers */
 
50
        };*/
49
51
 
50
52
        void *(*acqfcn) (bufsize size);;
51
53