(FEA) Featured for Location_Literalisation, Status_Literalisation etc.
This commit is contained in:
@@ -4,15 +4,14 @@
|
||||
# include <Compound/common.h>
|
||||
# include <Compound/status.h>
|
||||
|
||||
/*
|
||||
Higher the priority it is, the less time for lifespan it has.
|
||||
*/
|
||||
/* Higher the priority it is, the less lifespan it has. */
|
||||
|
||||
typedef struct {
|
||||
void *addr;
|
||||
size_t length;
|
||||
size_t size;
|
||||
int priority; // Negative for manual; Higher than 0 it is,
|
||||
// higher the priority is.
|
||||
bool alive;
|
||||
} Memory; // 20 Bytes
|
||||
|
||||
typedef struct {
|
||||
@@ -27,27 +26,27 @@ typedef struct {
|
||||
void (*deallocator)(void *addr);
|
||||
} MemoryPoolManager;
|
||||
|
||||
Status MemMan_Memory_Allocate(Memory *inst, size_t length);
|
||||
Status MemMan_Memory_Reallocate(Memory *inst, size_t length);
|
||||
void MemMan_Memory_Release(Memory *inst);
|
||||
Status MemMan_Memory_Prioritise(Memory *inst);
|
||||
Status MemMan_Memory_Deprioritise(Memory *inst);
|
||||
bool MemMan_Memory_Equals(Memory *inst, Memory *other);
|
||||
Status Memory_Create(Memory *inst, size_t size);
|
||||
Status Memory_Delete(Memory *inst);
|
||||
Status Memory_Allocate(Memory *inst);
|
||||
Status Memory_Reallocate(Memory *inst, size_t size);
|
||||
Status Memory_Release(Memory *inst);
|
||||
bool Memory_Equals(Memory *inst, Memory *other);
|
||||
|
||||
Status MemMan_MemoryPool_Create(MemoryPool *inst, size_t volume);
|
||||
Status MemMan_MemoryPool_Constr(MemoryPool *inst, size_t volume, int priority);
|
||||
Status MemMan_MemoryPool_AllocateAt(MemoryPool *inst, int idx, size_t sz);
|
||||
Status MemMan_MemoryPool_ReallocateAt(MemoryPool *inst, int idx, size_t sz);
|
||||
Status MemMan_MemoryPool_ReleaseAt(MemoryPool *inst, int idx);
|
||||
void MemMan_MemoryPool_Delete(MemoryPool *inst);
|
||||
Status MemoryPool_Create(MemoryPool *inst, size_t volume);
|
||||
Status MemoryPool_Constr(MemoryPool *inst, size_t volume, int priority);
|
||||
Status MemoryPool_AllocateAt(MemoryPool *inst, int idx, size_t sz);
|
||||
Status MemoryPool_ReallocateAt(MemoryPool *inst, int idx, size_t sz);
|
||||
Status MemoryPool_ReleaseAt(MemoryPool *inst, int idx);
|
||||
void MemoryPool_Delete(MemoryPool *inst);
|
||||
|
||||
Status MemMan_MemoryPoolManager_Create(MemoryPoolManager *inst,
|
||||
Status MemoryPoolManager_Create(MemoryPoolManager *inst,
|
||||
MemoryPool **members);
|
||||
Status MemMan_MemoryPoolManager_Constr(MemoryPoolManager *inst,
|
||||
Status MemoryPoolManager_Constr(MemoryPoolManager *inst,
|
||||
MemoryPool **members,
|
||||
void *(*allocator)(size_t sz),
|
||||
void (*deallocator)(void *addr));
|
||||
Status MemMan_MemoryPoolManager_Merge(MemoryPool *pool1, MemoryPool *pool2);
|
||||
Status MemMan_MemoryPoolManager_Divide(MemoryPool *src, int off, int len);
|
||||
Status MemoryPoolManager_Merge(MemoryPool *pool1, MemoryPool *pool2);
|
||||
Status MemoryPoolManager_Divide(MemoryPool *src, int off, int len);
|
||||
|
||||
#endif /* COMPOUND_MEMMAN_H */
|
||||
|
Reference in New Issue
Block a user