CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBLargeBlock.hpp
Go to the documentation of this file.
1 #pragma once
3 namespace CYB {
4  namespace Engine {
5  namespace Memory {
7  class LargeBlock : public Block {
8  private:
9 #ifdef DEBUG //Block debug headers
10  unsigned long long FMagicHeader;
11 #endif
12  unsigned long long FRemainingSize;
13 #ifdef DEBUG
14  unsigned long long FMagicFooter;
15 #endif
16  public:
25  static Block& AllocateBlock(LargeBlock*& ALargeBlock, const unsigned int ANewBlockSize) noexcept;
26 
34  LargeBlock(const unsigned long long ASpaceAvailable, Block* const ALeftBlock) noexcept;
35 
37  void Validate(void) const;
38 
45  LargeBlock& EatLeftBlock(void) noexcept;
46 
48  unsigned long long Size(void) const noexcept;
49 
51  void SetSize(const unsigned long long ANewSize) noexcept;
52  };
53  };
54  };
55 };
LargeBlock(const unsigned long long ASpaceAvailable, Block *const ALeftBlock) noexcept
Initialization constructor. Should be used with operator new in a memory location at least ASpaceAvai...
Used to identify the end of a Heap.
unsigned long long Size(void) const noexcept
Get the size of the Block. This version must be used when referring to large blocks ...
static Block & AllocateBlock(LargeBlock *&ALargeBlock, const unsigned int ANewBlockSize) noexcept
Allocate a portion of the LargeBlock's owned data to create a regular block.
unsigned long long FRemainingSize
The amount of space the block has available.
void SetSize(const unsigned long long ANewSize) noexcept
Set the Block's size. This version must be used when referring to large blocks
void Validate(void) const
Checks the validity of a Block HCFs if invalid. Has no effect outside of DEBUG mode. This version must be used when referring to large blocks
A unit of memory allocation.
Definition: CYBBlock.hpp:7
LargeBlock & EatLeftBlock(void) noexcept
Merge size and header into the size of the Block to the left. Does not modify free lists...