[New-bugs-announce] [issue21419] Use calloc() instead of malloc() for int << int (lshift)

STINNER Victor report at bugs.python.org
Fri May 2 22:51:47 CEST 2014

New submission from STINNER Victor:

Attached patch modifies long_lshift() to allocate the result using calloc() instead of malloc(). The goal is to avoid allocating physical memory for the least significat digits (zeros). According to my tests in issue #21233 (calloc), Linux and Windows have an optimized calloc() functions and at least Linux avoids allocating memory for pages initialized by zeros until pages at modified.

files: long_lshift.patch
keywords: patch
messages: 217787
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: Use calloc() instead of malloc() for int << int (lshift)
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file35135/long_lshift.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list