30 October 2019, 10:50 | #1 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Allocating memory within a 64K boundary
I need to allocate a chunk of memory that doesn't cross a 64K boundary, so that I can access it all with the same half of the address, so that I can update pointers within a copper list without worrying about them being half read when I do it.
Is there a smarter way to do this than by allocating 128K of memory and then just using part of it? Can I return the bits that I don't want to use? |
30 October 2019, 10:53 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
AROS has a way in its version but AmigaOS' Kickstart doesn't.
|
30 October 2019, 10:56 | #3 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
|
30 October 2019, 11:13 | #4 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
|
|
30 October 2019, 11:57 | #5 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
In my examples, in fact, as you may have noticed, I have always taken for granted an allocation of the kind
Which one to choose between the two methods? If you are not concerned about memory restraints, allocate x+65536. If yes, the Alloc(x+65536), Forbid(), Free(), AllocAbs(), Permit() work well, but it fragment slightly the memory pool. |
30 October 2019, 12:14 | #6 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Doing FreeMem on partial block isn't recommended but in practice it works.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Allocating 0xC00000 memory | alpine9000 | Coders. Asm / Hardware | 39 | 07 April 2018 00:49 |
Allocating Memory | mcgeezer | Coders. System | 2 | 30 March 2018 21:32 |
GoldenGate Bridgecard 64K Software? | ahandyman59 | support.Hardware | 7 | 05 April 2017 08:58 |
64k Amiga ECS Intro | 4pLaY | Amiga scene | 1 | 16 July 2012 09:31 |
Problem allocating some memory | CmdrVimes | Coders. General | 4 | 03 September 2010 23:23 |
|
|