An extension to AllocVecTagsList

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

An extension to AllocVecTagsList

Post by OldFart »

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
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
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: An extension to AllocVecTagsList

Post by broadblues »

The main desired feature being tagged AVT_ClearWIthValue, which now requires memset() or Utility's MemSet().
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?

eg.

ASOPOOL_MFlags , MEMF_SHARED | MEMF_CLEAR,
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: An extension to AllocVecTagsList

Post by tonyw »

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.
cheers
tony
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

Re: An extension to AllocVecTagsList

Post by OldFart »

@broadblues
ASOPOOL_MFlags , MEMF_SHARED | MEMF_CLEAR,
That one had escaped my query. Thanks, it works like I expected.

@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
Post Reply