English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 05 July 2013, 20:27   #1
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
How to shrink an area of reserved memory

OK here's my problem, I have loaded in a file into Fast Mem that contains some data that needs to be in Chip, so I copy it out. The Chip data is at the end of this block of data, so I want to free it up and get that fast mem back, without freeing up the whole block because I still need the rest of the stuff. In other words to shrink the allocated space, keeping the first part and discarding the latter part.

I know this must be possible because AMOS has a Bank Shrink function that preserves the address of the data. But how do I do this with Exec calls? If I try to "freemem" half way into an allocated area it seems to work but eventually crashes. I tried freeing the whole block and then AllocAbs it again, that doesn't work either
Mrs Beanbag is offline  
Old 05 July 2013, 21:02   #2
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,643
free/allocabs should work as long as you surround them with forbid/permit.. what do you mean by "doesn't work" ?
hooverphonique is offline  
Old 05 July 2013, 21:23   #3
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
well it just seems to hang, AllocAbs doesn't clear the memory to zeroes does it?
Mrs Beanbag is offline  
Old 05 July 2013, 21:36   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
Ugly Forbid()+FreeMem()+AllocAbs()+Permit() is the only working method. (EDIT: only if mungwall or similar program is not active..)

Note that first 8 bytes of FreeMem()'d memory region will be modified (Replaced with struct MemChunk).
Toni Wilen is online now  
Old 05 July 2013, 22:35   #5
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Thanks Toni! That was just the tip I needed, those first 8 bytes were really important!
Mrs Beanbag 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
Enable RDB mode and Surfaces/Sectors/Reserved mark_k support.WinUAE 1 17 February 2013 17:51
PFS3 continuosly giving "Block outside reserved area" -errors emuola project.ClassicWB 15 19 August 2012 19:47
Help, how do I shrink posted images?? DDNI support.Other 3 26 September 2011 01:02
Some rare-ish (possibly MIA or un-SPS'd) and/or shrink-wrapped Amiga games for sale eLowar MarketPlace 0 13 July 2009 12:41
Any utilities to shrink or stretch WB bg pics? Mojo2000 New to Emulation or Amiga scene 14 29 January 2003 23:39

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 12:54.

Top

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