From 03f7e6e629264fbccd1a1fc331cf258a80a055f1 Mon Sep 17 00:00:00 2001 From: deadwood Date: Sun, 31 Mar 2013 15:37:01 +0000 Subject: [PATCH] exec.library: support allocator context in AllocAbs git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@47123 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/exec/memory.c | 5 ++++- rom/exec/memory.h | 1 + rom/exec/memory_nommu.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rom/exec/memory.c b/rom/exec/memory.c index 164d12ef5b..170abe087e 100644 --- a/rom/exec/memory.c +++ b/rom/exec/memory.c @@ -100,9 +100,12 @@ void mhac_PoolMemHeaderSetup(struct MemHeader * mh, struct ProtectedPool * pool) mh->mh_Node.ln_Name = (STRPTR)pool; } +void mhac_MemChunkClaimed(struct MemChunk * mc, struct MemHeaderAllocatorCtx * mhac) +{ +} + #define mhac_IsIndexEmpty(a) (TRUE) #define mhac_ClearIndex(a) -#define mhac_MemChunkClaimed(a, b) #define mhac_MemChunkCreated(a, b, c) { (void)b; } #define mhac_GetBetterPrevMemChunk(a, b, c) (a) #define mhac_GetCloserPrevMemChunk(a, b, c) (a) diff --git a/rom/exec/memory.h b/rom/exec/memory.h index 9889a2421e..1fa6d0190a 100644 --- a/rom/exec/memory.h +++ b/rom/exec/memory.h @@ -62,6 +62,7 @@ struct MemHeaderAllocatorCtx; struct MemHeaderAllocatorCtx * mhac_GetSysCtx(struct MemHeader * mh, struct ExecBase * SysBase); void mhac_PoolMemHeaderSetup(struct MemHeader * mh, struct ProtectedPool * pool); +void mhac_MemChunkClaimed(struct MemChunk * mc, struct MemHeaderAllocatorCtx * mhac); struct MemHeader *FindMem(APTR address, struct ExecBase *SysBase); APTR stdAlloc(struct MemHeader *mh, struct MemHeaderAllocatorCtx *mhac, IPTR byteSize, ULONG requirements, struct TraceLocation *loc, struct ExecBase *SysBase); diff --git a/rom/exec/memory_nommu.c b/rom/exec/memory_nommu.c index 2335331fff..672c0543f5 100644 --- a/rom/exec/memory_nommu.c +++ b/rom/exec/memory_nommu.c @@ -129,6 +129,8 @@ APTR nommu_AllocAbs(APTR location, IPTR byteSize, struct ExecBase *SysBase) /* Found a chunk that fits? */ if((UBYTE *)p2+p2->mc_Bytes>=(UBYTE *)p4&&p2<=p3) { + mhac_MemChunkClaimed(p2, mhac_GetSysCtx(mh, SysBase)); + /* Check if there's memory left at the end. */ if((UBYTE *)p2+p2->mc_Bytes!=(UBYTE *)p4) { -- 2.11.4.GIT