[Python-checkins] r42797 - in python/trunk: Include/pyarena.h Python/pyarena.c
tim.peters
python-checkins at python.org
Thu Mar 2 21:37:33 CET 2006
Author: tim.peters
Date: Thu Mar 2 21:37:32 2006
New Revision: 42797
Modified:
python/trunk/Include/pyarena.h
python/trunk/Python/pyarena.c
Log:
Trimmed trailing whitespace.
Modified: python/trunk/Include/pyarena.h
==============================================================================
--- python/trunk/Include/pyarena.h (original)
+++ python/trunk/Include/pyarena.h Thu Mar 2 21:37:32 2006
@@ -26,7 +26,7 @@
/* This routines isn't a proper arena allocation routine. It takes
a PyObject* and records it so that it can be DECREFed when the
arena is freed.
- */
+ */
PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *);
#ifdef __cplusplus
Modified: python/trunk/Python/pyarena.c
==============================================================================
--- python/trunk/Python/pyarena.c (original)
+++ python/trunk/Python/pyarena.c Thu Mar 2 21:37:32 2006
@@ -1,7 +1,7 @@
#include "Python.h"
#include "pyarena.h"
-/* A simple arena block structure
+/* A simple arena block structure
Measurements with standard library modules suggest the average
allocation is about 20 bytes and that most compiles use a single
@@ -20,7 +20,7 @@
and a list of PyObject* pointers. PyObjects are decrefed
when the arena is freed.
*/
-
+
struct _arena {
block *a_head;
block *a_cur;
@@ -38,7 +38,7 @@
static block *
block_new(size_t size)
{
- /* Allocate header and block as one unit.
+ /* Allocate header and block as one unit.
ab_mem points just past header. */
block *b = (block *)malloc(sizeof(block) + size);
if (!b)
@@ -120,7 +120,7 @@
assert(arena);
#if defined(Py_DEBUG)
/*
- fprintf(stderr,
+ fprintf(stderr,
"alloc=%d size=%d blocks=%d block_size=%d big=%d objects=%d\n",
arena->total_allocs, arena->total_size, arena->total_blocks,
arena->total_block_size, arena->total_big_blocks,
@@ -134,7 +134,7 @@
}
void *
-PyArena_Malloc(PyArena *arena, size_t size)
+PyArena_Malloc(PyArena *arena, size_t size)
{
void *p = block_alloc(arena->a_cur, size);
if (!p)
@@ -157,7 +157,7 @@
}
int
-PyArena_AddPyObject(PyArena *arena, PyObject *obj)
+PyArena_AddPyObject(PyArena *arena, PyObject *obj)
{
int r = PyList_Append(arena->a_objects, obj);
if (r >= 0) {
More information about the Python-checkins
mailing list