Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7f0ea323
Commit
7f0ea323
authored
Apr 17, 2009
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reminder to dtoa.c to check for updates regularly.
Fix a bug in the memory management in dtoa.c.
parent
f633ff45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Python/dtoa.c
Python/dtoa.c
+10
-2
No files found.
Python/dtoa.c
View file @
7f0ea323
...
...
@@ -21,7 +21,11 @@
* This is dtoa.c by David M. Gay, downloaded from
* http://www.netlib.org/fp/dtoa.c on April 15, 2009 and modified for
* inclusion into the Python core by Mark E. T. Dickinson and Eric V. Smith.
* The major modifications are as follows:
*
* Please remember to check http://www.netlib.org/fp regularly (and especially
* before any Python release) for bugfixes and updates.
*
* The major modifications from Gay's original code are as follows:
*
* 0. The original code has been specialized to Python's needs by removing
* many of the #ifdef'd sections. In particular, code to support VAX and
...
...
@@ -53,6 +57,10 @@
* 5. The code has been reformatted to better fit with Python's
* C style guide (PEP 7).
*
* 6. A bug in the memory allocation has been fixed: to avoid FREEing memory
* that hasn't been MALLOC'ed, private_mem should only be used when k <=
* Kmax.
*
***************************************************************/
/* Please send bug reports for the original dtoa.c code to David M. Gay (dmg
...
...
@@ -342,7 +350,7 @@ Balloc(int k)
x
=
1
<<
k
;
len
=
(
sizeof
(
Bigint
)
+
(
x
-
1
)
*
sizeof
(
ULong
)
+
sizeof
(
double
)
-
1
)
/
sizeof
(
double
);
if
(
pmem_next
-
private_mem
+
len
<=
PRIVATE_mem
)
{
if
(
k
<=
Kmax
&&
pmem_next
-
private_mem
+
len
<=
PRIVATE_mem
)
{
rv
=
(
Bigint
*
)
pmem_next
;
pmem_next
+=
len
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment