C++ Logo


Advanced search

Re: [SG14] sizeof_block_metadata function, colony/hive, advice wanted

From: Paul M. Bendixen <paulbendixen_at_[hidden]>
Date: Thu, 25 Nov 2021 09:11:58 +0100
I'm curious as to why you would want to have a function that is only
inspecting a container throw? (and not be const).
I can follow your reasoning why you would want it, but is it something that
could be added later without breaking ABI (which seems to be the most
important thing in the world right now)?
If so, maybe it could be another paper that would perhaps be easier to get
in on its own.


tor. 25. nov. 2021 02.35 skrev Matt Bentley via SG14 <sg14_at_[hidden]

> Hi all,
> thinking about including a
> size_type sizeof_block_metadata(const size_t block_size)
> function for colony/hive, as this would allow the user to ascertain the
> amount of memory used by a memory block's metadata in colony (including
> skipfield), given the number of elements stored in that memory block.
> This is less important for colony which is a fixed implementation, more
> important for std::hive which could potentially have many alternative
> implementations and these might not be visible to the user in text form.
> The idea was that if someone knows how much memory is used by each block
> outside of the actual memory used to store the elements, that might aid
> in terms of knowing how much cache space is used by the metadata and
> people might be able to make better decisions about the min/max
> capacities of memory blocks (if they are specifying these manually) on
> that basis.
> The function would throw an exception if the block_size specified was
> outside the minimum/maximum block capacity ranges.
> My main question to you is whether this function is worth including - as
> it adds yet another function to the codebase.
> Thanks,
> M@
> _______________________________________________
> SG14 mailing list
> SG14_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg14

Received on 2021-11-25 02:12:11