On Tuesday, 23 February 2021 at 03:53:00 UTC, tsbockman wrote:
size_t alignedSize(size_t typeSize, size_t typeAlignment) pure
@safe nothrow @nogc {
version(assert) {
import core.bitop : bsr;
assert(typeAlignment == (size_t(1) <<
bsr(typeAlignment)));
}
size_t ret =
On Monday, 22 February 2021 at 02:23:27 UTC, Steven Schveighoffer
wrote:
Hm... but does TypeInfo detail alignment? If so, we can make
this work anyway, just bump up the size needed to a power-of-2
pool.
It doesn't even need to be a power-of-2, assuming the pools
themselves are properly aligne
On Monday, 22 February 2021 at 02:23:27 UTC, Steven Schveighoffer
wrote:
Hm... but does TypeInfo detail alignment?
Apparently not for TypeInfo_Class; .talign() returns the
alignment of a class *ref*, i.e., pointer size.
TypeInfo_Struct.talign() does return the struct alignment though
and cou
On 2/20/21 6:39 PM, kinke wrote:
On Saturday, 20 February 2021 at 18:43:53 UTC, Steven Schveighoffer wrote:
Last I checked*, the GC uses pools of 16-byte, 32-byte, 64-byte, etc
blocks.
That has changed [to reduce wastage]; the new bin sizes are here and
include sizes like 176 (11*16):
https:
On Saturday, 20 February 2021 at 18:43:53 UTC, Steven
Schveighoffer wrote:
Last I checked*, the GC uses pools of 16-byte, 32-byte,
64-byte, etc blocks.
That has changed [to reduce wastage]; the new bin sizes are here
and include sizes like 176 (11*16):
https://github.com/dlang/druntime/blob/7
On 2/20/21 2:13 AM, tsbockman wrote:
On Saturday, 20 February 2021 at 05:44:33 UTC, kinke wrote:
There's
https://github.com/dlang/druntime/blob/728f1d9c3b7a37eba4d59ee2637fb924053cba6d/src/core/internal/traits.d#L261.
Thanks! That's helpful.
But AFAIK, the GC only guarantees an alignment of
On 20/02/2021 8:13 PM, tsbockman wrote:
Well, that's just another reason not to use the GC for my current
project, then: I'm using 256-bit AVX vectors extensively.
You can still use the GC.
You just can't use it to allocate the classes you care about.
https://dlang.org/phobos/core_memory.html
On Saturday, 20 February 2021 at 05:44:33 UTC, kinke wrote:
There's
https://github.com/dlang/druntime/blob/728f1d9c3b7a37eba4d59ee2637fb924053cba6d/src/core/internal/traits.d#L261.
Thanks! That's helpful.
But AFAIK, the GC only guarantees an alignment of 16 and
doesn't respect any overaligned
On Friday, 19 February 2021 at 23:53:55 UTC, tsbockman wrote:
How can I get the alignment of a class instance? I know how to
get the size:
__traits(classInstanceSize, T)
But, there doesn't appear to be any equivalent trait for the
alignment.
There's
https://github.com/dlang/druntime/blob
How can I get the alignment of a class instance? I know how to
get the size:
__traits(classInstanceSize, T)
But, there doesn't appear to be any equivalent trait for the
alignment.
(Knowing the alignment of a class instance is required to
correctly use core.lifetime.emplace, or do any sort
10 matches
Mail list logo