cachetools v.0.3.1
ikod
geller.garry at gmail.com
Tue Aug 13 18:15:40 UTC 2019
On Tuesday, 13 August 2019 at 17:18:23 UTC, ag0aep6g wrote:
> On 13.08.19 11:34, ikod wrote:
>> What is it?
>>
>> cachetools - package with @safe and @nogc cache and containers
>> implementations.
> [...]
>> Project page: https://github.com/ikod/cachetools
>> docs: https://ikod.github.io/cachetools/
>
> They don't seem to actually be @safe. An example:
>
> ----
> import cachetools.containers.lists;
> import std.stdio;
> void main() @safe
> {
> DList!int dl;
> dl.insert_first(42);
> auto r = dl.range;
> dl.clear();
> writeln(r.front); /* Prints garbage, because it's accessing
> `free`d memory. */
> }
> ----
>
> As far as I can I see, that compiles because you have a bad
> @trusted here:
Probably this @trusted is not a problem (std.container.dlist also
contain @trusted code). I mistakenly ignored this case.
Thanks for your report, and I'll create issue on github.
> <https://github.com/ikod/cachetools/blob/ac72aafe979e2f95a343eb9d19b1b67915e4fc17/source/cachetools/containers/lists.d#L391>.
>
> Other containers probably have similar problems.
More information about the Digitalmars-d-announce
mailing list