A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/022398.html below:

[Python-Dev] Problem with the memory docs

[Python-Dev] Problem with the memory docs [Python-Dev] Problem with the memory docsMartin v. Loewis martin@v.loewis.de
05 Apr 2002 20:21:19 +0200
Guido van Rossum <guido@python.org> writes:

> I'm still confused.  What is the difference between calling malloc(1)
> and returning a non-null pointer "normally" ?

There is probably no practical difference. If you do malloc(0) and get
a non-zero pointer, you cannot access any memory behind this pointer;
if you invoke malloc(1), the C library must make sure that there is
atleast a single byte to access. This may take larger efforts - but
probably doesn't, in practice (unless your malloc implementation tries
to clear the memory it allocates with a fence pattern).

Regards,
Martin




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4