|
Extended Memory (and just a memory) questions |
Posted on: 2019/8/16 15:44
#1 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6823
|
Hi all !
Is there ppls who for real use Extended Memory ? As far as i aware its only broadblues with Sketchblock use it , so maybe question is mostly to him :) So, i currently have some app, which have that kind of memory alloc/free functions:
#include <stdlib.h>
The app in question, offten want to allocate 1.3gb , or 1.5gb, or 1gb. Which, in our limitation with 32bit and amigaos, when i have on running already eated about 250mb , leave us with less that 1.5gb. I write some simple test case and found, that i can only allocate just about ~1.4gb on one malloc, while i have 250 mb free. So in summ its just 1.650 in whole , but its already barier to burn and crash. So its of course not 2gb (as 31 bit addressing), but even not 1.8gb, but ~1.7gb of memory which can be used under aos4 :) So, question, can i use that Extended Memory thing, to just add relevant code in those helpers myalloc() and myfree() functions, so, they will just works as it, but just will have ability to alloc and 1.5gb via malloc, and 2gb and whatever extendent memory can handle. At least for me will be enough to have ability to alloc 1.7gb at one push, so leave aos4 with 300 mb used, but currently limited to ~1.4gb. |
|
|
Re: Extended Memory (and just a memory) questions |
Posted on: 2019/8/16 17:30
#2 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2013/10/17 16:21 From Hungary
Posts: 650
|
From what I understand you need to map extended memory into the lower 2GB address space, and then unmap it after you've done using it. If you have it mapped all the time, then there's no benefit to using it versus the normal memory allocation functions.
|
|
_________________
I see the jimmies have been rustled. |
||
|
Re: Extended Memory (and just a memory) questions |
Posted on: 2019/8/18 16:59
#3 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/12/4 23:15 Posts: 2232
|
@kas1e
Quote:
Yes, this is subtlity sometimes missed. You have a limit of 2Gb of (signed) address space, system ram is not the only thing usuing that space, the first 256 of gfx card memeory, PCI card memeory etc also eat inot that so that is why a X1K sometimes appears to run out of memory evn when it has 500Mb "free" . Quote:
No. To use Extended Memory in a useful way you need some kind of paging system. For example sketchblock has buffer objects composed of a number of pages of Extended (or normal) memory. When these buffer are reference via their 'get or set methods' then the relavant pages are paged in and out using the extended memeory API functions. I have a LRU cache of paged in pages to optimise this process and limit the amount of memory space used at any one time whilst slaos reducing cache misses. If your application needs to directly access very large blocks of memory in that way without any kind of access API (ie by simply dereferencing pointers,) you are not going to be able to use ExtMem for it. |
|