Would it be possible and viable to add a tag to the existing AVT_-range of tags, one for allocating memory from a pool. Suggested name: AVT_MemPool, whereby its ti_Data should contain the value returned by the AllocSysObject(ASOT_MEMPOOL, TAG_END) call.
This provides some of the features of AllocVecTags to pooled memory, which currently require 'manual' interference. The main desired feature being tagged AVT_ClearWIthValue, which now requires memset() or Utility's MemSet().
Currently, there is a big number of memory-related functions available. Too many, actually. Addition of this tag MIGHT obsolete 'AllocVecPooled()', maybe even one or two others.
Just a thought.
OldFart
An extension to AllocVecTagsList
An extension to AllocVecTagsList
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: An extension to AllocVecTagsList
You realise that for the most common usage case of clearling with ZERO you can just set MEMF_CLEAR when defining the flags for the pool?The main desired feature being tagged AVT_ClearWIthValue, which now requires memset() or Utility's MemSet().
eg.
ASOPOOL_MFlags , MEMF_SHARED | MEMF_CLEAR,
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: An extension to AllocVecTagsList
I think you'll find that memory allocated by AllocVecTags() comes from the system heap, hence is relatively slow to allocate.
Pooled memory is originally allocated from AllocVecTags(), but then divided up and allocated using fast allocation algorithms. The two APIs are not easily combined and there is probably nothing to gain by combining them.
Pooled memory is originally allocated from AllocVecTags(), but then divided up and allocated using fast allocation algorithms. The two APIs are not easily combined and there is probably nothing to gain by combining them.
cheers
tony
tony
Re: An extension to AllocVecTagsList
@broadblues
@tonyw
Thanks for clearing that up.
OldFart
That one had escaped my query. Thanks, it works like I expected.ASOPOOL_MFlags , MEMF_SHARED | MEMF_CLEAR,
@tonyw
Thanks for clearing that up.
OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10