OpenTTD Source 20250428-master-g68ba2735ea
|
Some methods of Pool are placed here in order to reduce compilation time and binary size. More...
#include "bitmath_func.hpp"
#include "math_func.hpp"
#include "pool_type.hpp"
#include "../error_func.h"
#include "../saveload/saveload_error.hpp"
Go to the source code of this file.
Macros | |
#define | DEFINE_POOL_METHOD(type) |
Helper for defining the method's signature. | |
#define | INSTANTIATE_POOL_METHODS(name) |
Force instantiation of pool methods so we don't get linker errors. | |
Functions | |
DEFINE_POOL_METHOD (inline void) | |
Resizes the pool so 'index' can be addressed. | |
DEFINE_POOL_METHOD (inline size_t) | |
Searches for first free index. | |
DEFINE_POOL_METHOD (inline void *) | |
Makes given index valid. | |
DEFINE_POOL_METHOD (void *) | |
Allocates new item. | |
DEFINE_POOL_METHOD (void) | |
Deallocates memory used by this index and marks item as free. | |
Some methods of Pool are placed here in order to reduce compilation time and binary size.
Definition in file pool_func.hpp.
#define DEFINE_POOL_METHOD | ( | type | ) |
Helper for defining the method's signature.
type | The return type of the method. |
Definition at line 24 of file pool_func.hpp.
#define INSTANTIATE_POOL_METHODS | ( | name | ) |
Force instantiation of pool methods so we don't get linker errors.
Only methods accessed from methods defined in pool.hpp need to be forcefully instantiated.
Definition at line 210 of file pool_func.hpp.
DEFINE_POOL_METHOD | ( | inline | size_t | ) |
Searches for first free index.
Definition at line 59 of file pool_func.hpp.
References FindFirstBit().
DEFINE_POOL_METHOD | ( | inline void * | ) |
Makes given index valid.
size | size of item |
index | index of item |
Definition at line 86 of file pool_func.hpp.
References SetBit().
DEFINE_POOL_METHOD | ( | inline void | ) |
Resizes the pool so 'index' can be addressed.
index | index we will allocate later |
Definition at line 35 of file pool_func.hpp.
References Align().
DEFINE_POOL_METHOD | ( | void * | ) |
Allocates new item.
Allocates new item with given index.
size | size of item |
size | size of item |
index | index of item |
Definition at line 114 of file pool_func.hpp.
DEFINE_POOL_METHOD | ( | void | ) |
Deallocates memory used by this index and marks item as free.
Destroys all items in the pool and resets all member variables.
size | the size of the freed object |
index | item to deallocate |
Definition at line 159 of file pool_func.hpp.
References ClrBit().