03 September 2012, 21:43 | #1 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
CreatePool MEMF_FAST
maybe somebody will fail with same approach like me, used:
Code:
exec.CreatePool(MEMF_FAST,a,b) but no - this succeeds. you will get a memory pool which is unable to allocate any memory. because the pool structure is allocated with MEMF_ANY! all subsequent allocations in the pool are tried with MEMF_FAST. |
03 September 2012, 22:17 | #2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
well, since the pool is grown dynamically, no memory is probably allocated before the first AllocPooled is called, and therefore CreatePool never even discovers that the system has no fastmem.. This may or may not appear stupid, depending on how you look at it..
the attributes used for allocating the pool structure itself rightfully has nothing to do with the memflags argument given to CreatePool.. |
05 September 2012, 00:30 | #3 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
yes, but but was it returns under my conditions is useless.
|
05 September 2012, 16:00 | #4 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
|
|
05 September 2012, 16:08 | #5 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
As for CreatePool, to me it somehow makes sense that it doesn't fail. Because all it does it allocating memory for the pool. And AllocPooled will later fail anyway if you try to alloc fast mem. So I don't really see a problem here. |
|
05 September 2012, 16:42 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
What's the reason for using MEMF_FAST? Fast RAM is preferred anyway so MEMF_ANY should serve well on a machine with Fast RAM as well as on a machine without.
|
05 September 2012, 16:45 | #7 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
because I don't want use memory pools on a machine which has no fast memory
|
05 September 2012, 16:56 | #8 | |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
Quote:
I understand too why it is working that way. From the customer point of view it simply does not deliver what it promises. It tells it can deliver fast mem and will never be able to do so. |
|
05 September 2012, 16:59 | #9 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I guess it really depends on how you look at it. I would have expected CreatePool to fail too if you request fast mem for the pool on a chip only machine. On the other hand I can perfectly understand why it successfully creates the pool. :P
But I think it's better to use other approaches to check for fast mem anyway. |
17 January 2019, 15:28 | #10 | |
Registered User
|
Hi!
Quote:
Just curious, but is it possible to hotplug fast memory on (certain) Amiga(s)? In that case, the AllocPooled call would be successful if you hotplug some fast RAM after CreatePool has been called. BTW, what happens if you do a AllocPooled with 0 bytes with MEMF_FAST? Does it fail, too? If yes, you could use that to check whether there is really some fast memory available. |
|
17 January 2019, 16:43 | #11 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
There are better/easier ways to check if fast memory is available. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|