johanengelen added a comment.
In https://reviews.llvm.org/D44321#1038241, @timotheecour wrote:
> > When druntime is initialized, a number of resources are allocated (e.g.
> > memory and mutex). Yes you initialize druntime once, I can see that. You
> > don't deinitialize druntime at all: that's
johanengelen added a comment.
In https://reviews.llvm.org/D44321#1038160, @timotheecour wrote:
> > How do you de-initialize druntime? (without de-init, there is a big mem
> > leak)
>
> There is no memory leak because `d_initialize` once (using c++11 static
> initialization pattern) and is inten
johanengelen added a comment.
In https://reviews.llvm.org/D44321#1034168, @johanengelen wrote:
> extern "C" char* lldbd_demangle(size_t length, const char* mangled) {
> if (mangled == "_D3fooFZv") // pseudo code
> return "void foo()";
> else
> return mangled;
> }
>
johanengelen added a comment.
In https://reviews.llvm.org/D44321#1034141, @timotheecour wrote:
> > It's a little more complicated for D because it's an out-of-tree compiler
> > so it poses interesting challenges.
>
> the demangling itself is thoroughly tested in
> https://github.com/dlang/drunt
johanengelen added inline comments.
Comment at: source/Plugins/Language/D/DLanguage.cpp:108
+
+auto fun0=lib2->getFun("d_initialize");
+(*fun0)();
timotheecour wrote:
> johanengelen wrote:
> > Would it help to initialize druntime using a static module con
johanengelen added inline comments.
Comment at: source/Plugins/Language/D/DLanguage.cpp:1
+//===-- DLanguage.cpp
+//
fix header, and also need to clang-format the file
Comment at: source/Plugins/Language/D/DLanguage.cpp:20
+
+char* lldbd_demang