Skip to content

Commit ce61f51

Browse files
committed
refactor: remove workaround for FLINT >= 3.0.0 and < 3.2.0
We now require FLINT >= 3.2.0. The workaround is no longer necessary.
1 parent ed1328f commit ce61f51

File tree

5 files changed

+0
-52
lines changed

5 files changed

+0
-52
lines changed

sources/declare.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,6 @@ extern WORD* flint_mul(PHEAD WORD *, WORD *);
16251625
extern WORD* flint_ratfun_add(PHEAD WORD *, WORD *);
16261626
extern int flint_ratfun_normalize(PHEAD WORD *);
16271627
extern WORD* flint_rem(PHEAD WORD *, WORD *, const WORD);
1628-
extern void flint_startup_init(void);
16291628
extern void flint_check_version(void);
16301629
#endif
16311630

sources/flintinterface.cc

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,36 +1720,6 @@ void flint::ratfun_read_poly(const WORD *a, fmpz_poly_t num, fmpz_poly_t den) {
17201720
}
17211721
/*
17221722
#] flint::ratfun_read_poly :
1723-
1724-
#[ flint::startup_init :
1725-
*/
1726-
// The purpose of this function is it work around threading issues in flint, reported in
1727-
// https://github.com/flintlib/flint/issues/1652 and fixed in
1728-
// https://github.com/flintlib/flint/pull/1658 . This implies versions prior to 3.1.0,
1729-
// but at least 3.0.0 (when gr was introduced).
1730-
void flint::startup_init(void) {
1731-
1732-
#if __FLINT_RELEASE >= 30000
1733-
// Here we initialize some gr contexts so that their method tables are populated. Crashes have
1734-
// otherwise been observed due to these two contexts in particular.
1735-
fmpz_t dummy_fmpz;
1736-
fmpz_init(dummy_fmpz);
1737-
fmpz_set_si(dummy_fmpz, 19);
1738-
1739-
gr_ctx_t dummy_gr_ctx_fmpz_mod;
1740-
gr_ctx_init_fmpz_mod(dummy_gr_ctx_fmpz_mod, dummy_fmpz);
1741-
gr_ctx_clear(dummy_gr_ctx_fmpz_mod);
1742-
1743-
gr_ctx_t dummy_gr_ctx_nmod;
1744-
gr_ctx_init_nmod(dummy_gr_ctx_nmod, 19);
1745-
gr_ctx_clear(dummy_gr_ctx_nmod);
1746-
1747-
fmpz_clear(dummy_fmpz);
1748-
#endif
1749-
}
1750-
/*
1751-
#] flint::startup_init :
1752-
17531723
#[ flint::to_argument_mpoly :
17541724
*/
17551725
// Convert a fmpz_mpoly_t to a FORM argument (or 0-terminated list of terms: with_arghead==false).

sources/flintinterface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ namespace flint {
141141
fmpz_mpoly_ctx_t);
142142
void ratfun_read_poly(const WORD *, fmpz_poly_t, fmpz_poly_t);
143143

144-
void startup_init(void);
145-
146144
uint64_t to_argument_mpoly(PHEAD WORD *, const bool, const bool, const bool, const uint64_t,
147145
const fmpz_mpoly_t, const var_map_t &, const fmpz_mpoly_ctx_t);
148146
uint64_t to_argument_mpoly(PHEAD WORD *, const bool, const bool, const bool, const uint64_t,

sources/flintwrap.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,6 @@ WORD* flint_rem(PHEAD WORD *a, WORD *b, const WORD must_fit_term) {
276276
}
277277
/*
278278
#] flint_rem :
279-
#[ flint_startup_init :
280-
*/
281-
void flint_startup_init(void) {
282-
flint::startup_init();
283-
}
284-
/*
285-
#] flint_startup_init :
286279
#[ flint_check_version :
287280
*/
288281

sources/setfile.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -776,18 +776,6 @@ int AllocSetups(void)
776776
AM.TempDir = strDup1((UBYTE *)(sp->value),"tempdir");
777777
}
778778
*/
779-
780-
/*
781-
As part of the setup, we possibly need to work around a flint multi-threading
782-
bug which was fixed in version 3.1.0. This function should be called by the
783-
master only, before the worker threads start processing terms.
784-
*/
785-
#ifdef WITHFLINT
786-
#if __FLINT_RELEASE < 30100
787-
flint_startup_init();
788-
#endif
789-
#endif
790-
791779
return(error);
792780
}
793781

0 commit comments

Comments
 (0)