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

« back to all changes in this revision

Viewing changes to rts/System/MemPool.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
 
#ifndef CMEMPOOL_H
2
 
#define CMEMPOOL_H
 
1
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
 
2
 
 
3
#ifndef _MEM_POOL_H_
 
4
#define _MEM_POOL_H_
3
5
 
4
6
#include <new>
5
7
 
7
9
 
8
10
class CMemPool
9
11
{
10
 
 public:
11
 
  CMemPool();
12
 
  void *Alloc(size_t n);
13
 
  void Free(void *p,size_t n);
14
 
  ~CMemPool();
15
 
 private:
16
 
  void* nextFree[MAX_MEM_SIZE+1];
17
 
  int poolSize[MAX_MEM_SIZE+1];
 
12
public:
 
13
        CMemPool();
 
14
        void *Alloc(size_t n);
 
15
        void Free(void *p,size_t n);
 
16
        ~CMemPool();
 
17
 
 
18
private:
 
19
        void* nextFree[MAX_MEM_SIZE+1];
 
20
        int poolSize[MAX_MEM_SIZE+1];
18
21
};
 
22
 
19
23
extern CMemPool mempool;
20
 
#endif
 
24
 
 
25
#endif // _MEM_POOL_H_
21
26