Displaying 3 results from an estimated 3 matches for "instantiatemulticlassdef".
2014 Sep 25
5
[LLVMdev] New type of smart pointer for LLVM
...several temporary ugly fixes of memory leaks in
TGParser.cpp which would be great to be refactored using smart pointers.
D5443 <http://reviews.llvm.org/D5443> demonstrates how the solution with
a certain type of smart pointer would look like (see changes in
TGParser::ParseDef(), TGParser::InstantiateMulticlassDef() and
TGParser::ParseSimpleValue()).
Briefly:
consider a leaky example:
{
T* p = new T;
if (condition1) {
f(p); // takes ownership of p
}
p->SomeMethod();
if (condition2) {
return nullptr; // Leak!
}
g(p); // don't take ownership of p
return p;
}
The pr...
2014 Sep 25
2
[LLVMdev] New type of smart pointer for LLVM
...eral temporary ugly fixes of memory leaks in
> TGParser.cpp
> > which would be great to be refactored using smart pointers. D5443
> demonstrates
> > how the solution with a certain type of smart pointer would look like
> (see
> > changes in TGParser::ParseDef(), TGParser::InstantiateMulticlassDef() and
> > TGParser::ParseSimpleValue()).
> >
> > Briefly:
> > consider a leaky example:
> > {
> > T* p = new T;
> > if (condition1) {
> > f(p); // takes ownership of p
> > }
> > p->SomeMethod();
> >
> > if (con...
2014 Oct 01
4
[LLVMdev] New type of smart pointer for LLVM
...y ugly fixes of memory leaks in TGParser.cpp
> which would be great to be refactored using smart pointers. D5443
> <http://reviews.llvm.org/D5443> demonstrates how the solution with a
> certain type of smart pointer would look like (see changes in TGParser::ParseDef(),
> TGParser::InstantiateMulticlassDef() and TGParser::ParseSimpleValue()).
>
> Briefly:
> consider a leaky example:
> {
> T* p = new T;
> if (condition1) {
> f(p); // takes ownership of p
> }
> p->SomeMethod();
>
> if (condition2) {
> return nullptr; // Leak!
> }
>
>...