English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 October 2019, 10:50   #1
deimos
It's coming back!
 
deimos's Avatar
 
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?
deimos is offline  
Old 30 October 2019, 10:53   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
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.
Samurai_Crow is offline  
Old 30 October 2019, 10:56   #3
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
http://eab.abime.net/showthread.php?...t=64k+boundary
DanScott is offline  
Old 30 October 2019, 11:13   #4
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by DanScott View Post
Thank you, that gives me exactly what I need.
deimos is offline  
Old 30 October 2019, 11:57   #5
ross
Defendit numerus
 
ross's Avatar
 
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.
ross is offline  
Old 30 October 2019, 12:14   #6
meynaf
son of 68k
 
meynaf's Avatar
 
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.
meynaf is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:50.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12136 seconds with 15 queries