English Amiga Board

Go Back   English Amiga Board > Coders > Coders. General

Thread Tools
Old 30 October 2019, 11:50   #1
Registered User

Join Date: Jul 2018
Location: France
Posts: 537
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, 11:53   #2
Total Chaos forever!

Samurai_Crow's Avatar
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 45
Posts: 1,339
Send a message via Yahoo to Samurai_Crow
AROS has a way in its version but AmigaOS' Kickstart doesn't.
Samurai_Crow is offline  
Old 30 October 2019, 11:56   #3
Lemon. / Core Design

DanScott's Avatar
Join Date: Mar 2016
Location: Sunny Bournemouth, UK
Posts: 539
DanScott is offline  
Old 30 October 2019, 12:13   #4
Registered User

Join Date: Jul 2018
Location: France
Posts: 537
Originally Posted by DanScott View Post
Thank you, that gives me exactly what I need.
deimos is offline  
Old 30 October 2019, 12:57   #5
Per aspera ad astra

ross's Avatar
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,425
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, 13:14   #6
son of 68k
meynaf's Avatar
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,667
Doing FreeMem on partial block isn't recommended but in practice it works.
meynaf is online now  

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 01:49
Allocating Memory mcgeezer Coders. System 2 30 March 2018 22:32
GoldenGate Bridgecard 64K Software? ahandyman59 support.Hardware 7 05 April 2017 09:58
64k Amiga ECS Intro 4pLaY Amiga scene 1 16 July 2012 10:31
Problem allocating some memory CmdrVimes Coders. General 4 04 September 2010 00: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 14:27.

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