Skip to content

Commit 89f6884

Browse files
Removed free list consistency checks, removed handling of MEMF_MANAGED, as it is never set.
1 parent e5eb83d commit 89f6884

12 files changed

Lines changed: 184 additions & 61 deletions

rom/exec/allocate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
{
8585
AROS_LIBFUNC_INIT
8686

87+
#ifdef HANDLE_MANAGED_MEM
8788
if ((freeList->mh_Node.ln_Type == NT_MEMORY) && IsManagedMem(freeList))
8889
{
8990
struct MemHeaderExt *mhe = (struct MemHeaderExt *)freeList;
@@ -94,7 +95,8 @@
9495
return NULL;
9596
}
9697
else
97-
{
98+
#endif
99+
{
98100
struct TraceLocation tp = CURRENT_LOCATION("Allocate");
99101
APTR res;
100102

rom/exec/allocpooled.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
if(!memSize)
7676
return NULL;
7777

78+
#ifdef HANDLE_MANAGED_MEM
7879
if (IsManagedMem(mhe))
7980
{
8081
ULONG poolrequirements = (ULONG)(IPTR)mhe->mhe_MemHeader.mh_First;
@@ -85,7 +86,8 @@
8586
return NULL;
8687
}
8788
else
88-
{
89+
#endif
90+
{
8991
struct TraceLocation tp = CURRENT_LOCATION("AllocPooled");
9092
struct Pool *pool = poolHeader + MEMHEADER_TOTAL;
9193

rom/exec/allocvecpooled.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
/* 0-sized allocation results in returning NULL (API guarantee) */
5757
if(!memSize)
5858
return NULL;
59-
59+
#ifdef HANDLE_MANAGED_MEM
6060
if (IsManagedMem(mhe))
6161
{
6262
ULONG poolrequirements = (ULONG)(IPTR)mhe->mhe_MemHeader.mh_First;
@@ -67,7 +67,8 @@
6767
return NULL;
6868
}
6969
else
70-
{
70+
#endif
71+
{
7172
IPTR *memory;
7273

7374
if (poolHeader == NULL) return NULL;

rom/exec/createpool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
* If the pool is in managed memory, don't bother any further setup. The
140140
* pool should do the rest self.
141141
*/
142+
#ifdef HANDLE_MANAGED_MEM
142143
if (IsManagedMem(firstPuddle))
143144
{
144145
D(bug("Managed pool\n");)
@@ -152,7 +153,8 @@
152153
firstPuddle->mh_First = (APTR)(IPTR)requirements;
153154
}
154155
else
155-
{
156+
#endif
157+
{
156158
/*
157159
* Add the puddle to the list (yes, contained in itself).
158160
* This is the first puddle so it's safe to use AddTail() here.

rom/exec/deallocate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
{
5959
AROS_LIBFUNC_INIT
6060

61+
#ifdef HANDLE_MANAGED_MEM
6162
if ((freeList->mh_Node.ln_Type == NT_MEMORY) && IsManagedMem(freeList))
6263
{
6364
struct MemHeaderExt *mhe = (struct MemHeaderExt *)freeList;
@@ -66,7 +67,8 @@
6667
mhe->mhe_Free(mhe, memoryBlock, byteSize);
6768
}
6869
else
69-
{
70+
#endif
71+
{
7072
struct TraceLocation tp = CURRENT_LOCATION("Deallocate");
7173

7274
/* If there is no memory free nothing */

rom/exec/deletepool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@
6161
{
6262
struct TraceLocation tp = CURRENT_LOCATION("DeletePool");
6363

64+
#ifdef HANDLE_MANAGED_MEM
6465
if (IsManagedMem(poolHeader))
6566
{
6667
/* Do nothing, everything is handled in FreeMemHeader */
6768
}
6869
else
69-
{
70+
#endif
71+
{
7072
struct Pool *pool = poolHeader + MEMHEADER_TOTAL;
7173
struct Node *p, *p2; /* Avoid casts */
7274

rom/exec/freepooled.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@
6161
if(!memSize || !memory)
6262
return;
6363

64+
#ifdef HANDLE_MANAGED_MEM
6465
if (IsManagedMem(mhe))
6566
{
6667
if (mhe->mhe_Free)
6768
mhe->mhe_Free(mhe, memory, memSize);
6869
}
6970
else
70-
{
71+
#endif
72+
{
7173
struct TraceLocation tp = CURRENT_LOCATION("FreePooled");
7274

7375
InternalFreePooled(poolHeader, memory, memSize, &tp, SysBase);

rom/exec/freevecpooled.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@
5757
if(!memory)
5858
return;
5959

60+
#ifdef HANDLE_MANAGED_MEM
6061
if (IsManagedMem(mhe))
6162
{
6263
if (mhe->mhe_FreeVec)
6364
mhe->mhe_FreeVec(mhe, memory);
6465
}
6566
else
66-
{
67+
#endif
68+
{
6769
if (memory != NULL)
6870
{
6971
IPTR *real = (IPTR *) memory;

0 commit comments

Comments
 (0)