An extension to AllocVecTagsList

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
OldFart
Posts: 55
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
Sleeping X5000, eagerly awaiting awakening
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 (for sale, willing to split)
RaspBerry Pi 2B, 3B & 4B (4Gb)
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 591
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: 1445
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: 55
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
Sleeping X5000, eagerly awaiting awakening
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 (for sale, willing to split)
RaspBerry Pi 2B, 3B & 4B (4Gb)
Post Reply