Changeset View
Changeset View
Standalone View
Standalone View
source/lib/allocators/freelist.h
Show All 17 Lines | |||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
*/ | */ | ||||
#ifndef INCLUDED_ALLOCATORS_FREELIST | #ifndef INCLUDED_ALLOCATORS_FREELIST | ||||
#define INCLUDED_ALLOCATORS_FREELIST | #define INCLUDED_ALLOCATORS_FREELIST | ||||
#include <cstring> | |||||
// "freelist" is a pointer to the first unused element or a sentinel. | // "freelist" is a pointer to the first unused element or a sentinel. | ||||
// their memory holds a pointer to the previous element in the freelist | // their memory holds a pointer to the previous element in the freelist | ||||
// (or its own address in the case of sentinels to avoid branches) | // (or its own address in the case of sentinels to avoid branches) | ||||
// | // | ||||
// rationale for the function-based interface: a class encapsulating the | // rationale for the function-based interface: a class encapsulating the | ||||
// freelist pointer would force each header to include this header, | // freelist pointer would force each header to include this header, | ||||
// whereas this approach only requires a void* pointer and calling | // whereas this approach only requires a void* pointer and calling | ||||
// mem_freelist_Sentinel from the implementation. | // mem_freelist_Sentinel from the implementation. | ||||
Show All 31 Lines |
Wildfire Games · Phabricator