Bug 16298 – [ER] lazily register standard codecs from std.encoding

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-19T18:07:00Z
Last change time
2017-01-04T15:24:41Z
Assigned to
nobody
Creator
ketmar

Attachments

IDFilenameSummaryContent-TypeSize
16040001-std.encoding-initialization-hackfix.patchlazily registers standard codecsapplication/mbox3666

Comments

Comment #0 by ketmar — 2016-07-19T18:07:53Z
Created attachment 1604 lazily registers standard codecs the attached patch seems to work ok with my system. it registers standard codecs when on first call to `EncodingScheme.create()`, and it also exposes `EncodingScheme.registerStandardCodecs()` function, which can be called to manually register standard codecs if it is necessary in some other module ctor. it is safe to call `EncodingScheme.registerStandardCodecs()` multiple times, and from multiple threads. this patch solves issue 16291 for the time being, until the proper fix for cycle detection in module ctors isn't complete.
Comment #1 by greeenify — 2017-01-04T15:09:32Z
> for the time being, until the proper fix for cycle detection in module ctors isn't complete. AFAIK the cycle detection has been fixed (https://github.com/dlang/druntime/pull/1602), so I think this makes this issue obsolete (please reopen if you disagree) As you might have realized your patch got quite stalled here, so in the future either submitting a PR or posting it to the mailing list could lead to more success ;-)
Comment #2 by ketmar — 2017-01-04T15:24:41Z
this was just a place to keep the temporary solution anyway. Steven took care of that since, i believe. sorry, i forgot to close this myself. and yes, i know that patches in bugzilla rots forever without any movement (and patches published in NG are lost at the moment they put there ;-), but i am not using github, so this is the only way i can contribute. alas.