On 10/29/21 8:49 PM, Stanislav Blinov wrote:
On Friday, 29 October 2021 at 21:00:48 UTC, Steven Schveighoffer wrote:
This is incorrect, the buckets are each heap allocated. Just the array
of bucket pointers would change.
In addition, AAs do not deallocate the key/value pairs ever. You are
sa
On Saturday, 30 October 2021 at 11:59:15 UTC, Steven
Schveighoffer wrote:
It should be documented. There isn't a valid way to remove
these requirements, even if they are currently just an
implementation detail -- code already depends on these
properties.
And D is a GC-based language, especi
On 10/30/21 10:51 AM, Stanislav Blinov wrote:
On Saturday, 30 October 2021 at 11:59:15 UTC, Steven Schveighoffer wrote:
It should be documented. There isn't a valid way to remove these
requirements, even if they are currently just an implementation detail
-- code already depends on these prope
On Saturday, 30 October 2021 at 16:55:03 UTC, Steven
Schveighoffer wrote:
auto v = k in aa;
aa.remove(k);
How can the GC/compiler work out that there is still a
reference?
??? The same way it does for all other references.
I think either you misunderstood me, or I misunderstood you.
On 10/30/21 1:38 PM, Stanislav Blinov wrote:
On Saturday, 30 October 2021 at 16:55:03 UTC, Steven Schveighoffer wrote:
auto v = k in aa;
aa.remove(k);
How can the GC/compiler work out that there is still a reference?
??? The same way it does for all other references.
I think either you misu
On Saturday, 30 October 2021 at 17:45:57 UTC, Steven
Schveighoffer wrote:
You said "deallocating unreferenced elements". I thought you
meant elements unreferenced by the AA.
Yup, I misunderstood you :)
What I mean is, the AA isn't going to change implementations
where it now deallocates val
On Saturday, 30 October 2021 at 00:52:23 UTC, Imperatorn wrote:
On Saturday, 30 October 2021 at 00:49:04 UTC, Stanislav Blinov
wrote:
On Friday, 29 October 2021 at 21:00:48 UTC, Steven
Schveighoffer wrote:
This is incorrect, the buckets are each heap allocated. Just
the array of bucket pointe
On Saturday, 30 October 2021 at 18:31:16 UTC, Andrey Zherikov
wrote:
I did small test and it printed the same values three times so
even rehash doesn't change the address of the value:
So it seems pretty safe to store a pointer to a value in AA.
And I agree that this should definitely be doc
On Saturday, 30 October 2021 at 20:05:17 UTC, Stanislav Blinov
wrote:
On Saturday, 30 October 2021 at 18:31:16 UTC, Andrey Zherikov
wrote:
I did small test and it printed the same values three times so
even rehash doesn't change the address of the value:
So it seems pretty safe to store a po
On Saturday, 30 October 2021 at 20:19:58 UTC, Imperatorn wrote:
https://dlang.org/spec/garbage.html#pointers_and_gc
What test could be written to verify the behaviour?
Assuming the GC was moving?
You'd need a loop allocating different sizes, storing the
addresses somewhere the GC won't see
On 10/30/21 2:31 PM, Andrey Zherikov wrote:
On Saturday, 30 October 2021 at 00:52:23 UTC, Imperatorn wrote:
On Saturday, 30 October 2021 at 00:49:04 UTC, Stanislav Blinov wrote:
On Friday, 29 October 2021 at 21:00:48 UTC, Steven Schveighoffer wrote:
This is incorrect, the buckets are each heap
On Saturday, 30 October 2021 at 21:20:15 UTC, Stanislav Blinov
wrote:
On Saturday, 30 October 2021 at 20:19:58 UTC, Imperatorn wrote:
https://dlang.org/spec/garbage.html#pointers_and_gc
What test could be written to verify the behaviour?
Assuming the GC was moving?
If the GC were moving,
On Saturday, 30 October 2021 at 22:47:57 UTC, Elronnd wrote:
If the GC were moving, it would also have to move the pointers
you took to AA elements. You would never get stale pointers in
any event.
Who said you would?..
On 10/30/21 3:47 PM, Elronnd wrote:
> If the GC were moving, it would also have to move the pointers you took
> to AA elements.
I doubt D's GC can ever change pointer values because the values may be
hiding inside e.g. ulong variables. And we would definitely not want the
GC to change ulong va
On Sunday, 31 October 2021 at 02:56:35 UTC, Ali Çehreli wrote:
On 10/30/21 3:47 PM, Elronnd wrote:
> If the GC were moving, it would also have to move the
pointers you took
> to AA elements.
I doubt D's GC can ever change pointer values because the
values may be hiding inside e.g. ulong variab
On 10/29/21 7:10 AM, Stanislav Blinov wrote:
On Friday, 29 October 2021 at 11:05:14 UTC, Imperatorn wrote:
On Thursday, 28 October 2021 at 01:39:10 UTC, Thomas Gregory wrote:
I am a maintainer of the
[dhtslib](https://github.com/blachlylab/dhtslib) package and I have
been running into issues w
On Friday, 29 October 2021 at 14:20:09 UTC, Ali Çehreli wrote:
Unsigned!T abs(T)(const(T) x) if(isIntegral!T)
{
static if(isSigned!T) if(x < 0) return cast(Unsigned!T)-x;
return x;
}
void main() {
int a = -5;
int b = -4;
writeln(a + abs(b)); // -5 + 4 == -1? (No!)
}
The program prin
17 matches
Mail list logo