Skip to content

Commit

Permalink
Merge pull request #223 from hannes14/mem_acc
Browse files Browse the repository at this point in the history
memory access: leaks
  • Loading branch information
hannes14 committed Apr 24, 2020
2 parents 47d6b73 + 4d444e1 commit bc5ea27
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions deps/src/rings.cpp
Expand Up @@ -73,8 +73,7 @@ void singular_define_rings(jlcxx::Module & Singular)
Singular.method("rBitmask",
[](ip_sring * r) { return (unsigned int)r->bitmask; });
Singular.method("rPar", [](coeffs cf){
coeffs cf_ptr = nCopyCoeff(cf);
return n_NumberOfParameters(cf_ptr);
return n_NumberOfParameters(cf);
});
Singular.method("p_Delete", [](spolyrec * p, ip_sring * r) {
return p_Delete(&p, r);
Expand Down Expand Up @@ -188,6 +187,7 @@ void singular_define_rings(jlcxx::Module & Singular)
rChangeCurrRing(r);
res = kNF(I, NULL, p, 0, KSTD_NF_LAZY);
rChangeCurrRing(origin);
I->m[0] = NULL;
id_Delete(&I, r);
if (res == NULL)
return true;
Expand Down Expand Up @@ -220,20 +220,22 @@ void singular_define_rings(jlcxx::Module & Singular)
a.push_back(content[i]);
}
rChangeCurrRing(origin);
delete v;
return I;
});
Singular.method("singclap_factorize",
[](spolyrec * p, jlcxx::ArrayRef<int> a, ip_sring * r) {
const ring origin = currRing;
rChangeCurrRing(r);
const ring origin = currRing;
rChangeCurrRing(r);
intvec * v = NULL;
ideal I = singclap_factorize(pCopy(p), &v, 0, currRing);
ideal I = singclap_factorize(p_Copy(p,r), &v, 0, r);
int * content = v->ivGetVec();
for(int i=0; i<v->length(); i++)
{
a.push_back(content[i]);
}
rChangeCurrRing(origin);
delete v;
return I;
});
Singular.method("p_Content", [](spolyrec * p, ip_sring * r) {
Expand Down

2 comments on commit bc5ea27

@fingolfin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/13589

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" bc5ea27b935948f08d22bfa344f9e2f783bd8126
git push origin v0.3.0

Please sign in to comment.