01 November 2022, 16:24 | #1 |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 36
|
AmiBlitz3: Dim and FreeMem
Hello,
in a loop I Dim a array like Code:
Dim filebuffer.b(Lof(0)) After some calculations I want to free this initialized memory, because after some loop iterations I get at this point a "Out of memory". My idea was to use Code:
FreeMem &filebuffer(0), Lof(0) What is the best practice to free the memory after used a array? |
01 November 2022, 20:35 | #2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,352
|
I don't think arrays that have been dimmed can be freed (or, indeed, standard variables). They are only disposed of when the program ends. The main alternative I can see is to allocate a block of RAM and access it directly, then free it afterwards.
|
01 November 2022, 20:46 | #3 | |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 36
|
Quote:
I found a solution suggest by you in another thread. I use Bank-methods to solve this/my problem. I don't feel ready to work safely with pointers and address locations yet. But thank you very much! I've learned so much today (by you)! |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dark/Dim Image from A1200 | amifan | support.Hardware | 1 | 04 March 2021 06:34 |
[blitz] re-dim arrays inside statement/function | peceha | Coders. Blitz Basic | 7 | 24 June 2020 13:10 |
FreeMem partial blocks? | Keir | Coders. System | 25 | 29 January 2019 23:54 |
Blitz help with Dim | gazj82 | Coders. Blitz Basic | 12 | 28 September 2017 17:47 |
A2000 with Picasso II, screen is dim | LuigiThirty | support.Hardware | 1 | 16 August 2017 07:33 |
|
|