| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Rename time.steady() to time.monotonic()
* On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of
QueryPerformanceCounter()
* time.monotonic() uses CLOCK_HIGHRES if available
* Add time.get_clock_info(), time.perf_counter() and time.process_time()
functions
|
| |
| |
| |
| | |
finder instead of using some (now non-existent) implicit finder.
|
| |
| |
| |
| | |
ImportWarning is raised if sys.meta_path is found to be empty.
|
| |
| |
| |
| |
| |
| | |
* In debug mode, fill the string data with invalid characters
* Simplify also reference counting in PyCodec_BackslashReplaceErrors()
and PyCodec_XMLCharRefReplaceError()
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
multiprocessing Connections.
Patch by Richard Oudkerk (sbt).
|
| |
| |
| |
| | |
some Solaris constants too)
|
| | |
|
| |
| |
| |
| | |
this is more readable.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) Rename _mpd_qbarrett_divmod into _mpd_base_ndivmod: The function is
only marginally related to either Barrett's algorithm or to the version
in Hasselstrom's paper.
2) In places where the proof assumes exact operations, use new versions of
add/sub/multiply that set NaN/Invalid_operation if this condition is
not met. According to the proof this cannot happen, so this should be
regarded as an extra safety net.
3) Raise Division_impossible for operands with a number of digits greater
than MPD_MAX_PREC. This facilitates the audit of the function and can
practically only occur in the 32-bit version under conditions where
a MemoryError is already imminent.
4) Use _mpd_qmul() in places where the result can exceed MPD_MAX_PREC in
a well defined manner.
5) Test for mpd_isspecial(qq) in a place where the addition of one
can theoretically trigger a Malloc_error.
6) Remove redundant code in _mpd_qdivmod().
7) Add many comments.
|
| | |
|
| |
| |
| |
| | |
Patch by Stefan Behnel.
|
| |
| |
| |
| |
| | |
_multiprocessing.win32 modules now live in a single module "_winapi".
Patch by sbt.
|
| |
| |
| |
| |
| |
| |
| |
| | |
in order to understand the algorithm anyway.
2) v->exp == -v->digits may be assumed.
3) Fix comment (v always shares data with a).
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rightfully states that an mpd_t with a coefficient flagged as MPD_CONST_DATA
must not be in the position of the result operand. In this particular case
several assumptions guarantee that a resize will never occur in all possible
code paths, which was the reason for using MPD_CONST_DATA and saving an
instruction by omitting the initialization of tmp.alloc.
For readability, tmp is now flagged as MPD_STATIC_DATA and tmp.alloc
is initialized.
|
| |
| |
| |
| | |
files.
|
| |
| |
| |
| |
| |
| |
| | |
rewriting functionality in pure Python.
To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Only use a single #ifdef for the 3 functions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Resizing is used _inside_ libmpdec functions, and it is permitted to
change x->alloc several times while setting x->len at the end of the
function. Therefore, for dynamic mpd_t x->alloc can _temporarily_ drop
below x->len. Of course the final result always has x->len <= x->alloc.
For static mpd_t this cannot happen, since resizing to a smaller
coefficient is a no-op.
2) Remove micro optimization in mpd_switch_to_dyn(): Previously only the
valid initialized part of the existing coefficient up to x->len was
copied to the new dynamic memory area. Now copying does the same as
realloc() and the entire old memory area is copied.
The rationale for this change is that it is no longer needed to memorize
the explanation given in 1).
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
MPD_MINALLOC. Previously the resize was skipped as a micro optimization.
|
| |
| |
| |
| | |
locality for regularly sized coefficients.
|
| | |
|
| |
| |
| |
| | |
presence of a __del__ attribute on objects, rather it uses the tp_del slot.
|
| |
| |
| |
| |
| | |
is defined as an int while everyone else expects a long regardless of
length.
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | | |
Found with Clang's Static Analyzer.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
2) Assert that the source operand is not special. Prevent resulting assert
failure (harmless) by initializing flags before calling mpd_qshiftr_inplace.
3) Save a couple of instructions (mpd_zerocoeff already sets digits and len).
Reorder initialization to match the order in the mpd_t struct.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
rather than raising RuntimeError (allocated space is sufficient for the
additional character).
|
| |
| |
| |
| |
| | |
conversion in the Decimal constructor. Exact here refers to the
representation and not to the value (clamping does not change the value).
|
| | |
|