[Patches] [ python-Patches-552438 ] PyBufferObject fixes

noreply@sourceforge.net noreply@sourceforge.net
Tue, 07 May 2002 11:51:18 -0700


Patches item #552438, was opened at 2002-05-05 00:26
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=552438&group_id=5470

Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Scott Gilbert (xscott)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyBufferObject fixes

Initial Comment:
This patch fixes these problems:

  1) Dangling pointer problem
  2) buffer allocated by PyBuffer_New not aligned

The PyBufferObject acts differently depending on 
whether it allocated the memory or if it's borrowing 
the memory from a PyBufferProcs supporting object.

In the case of allocating it's own memory, I made a 
slight addition that adds some padding so that the ptr 
is on a sizeof(double) boundary.

In the case of borrowing another objects PyBufferProcs 
memory, PyBufferObject no longer caches the pointer.  
This might slow things down (probably not by much), 
but it keeps PyBufferObject from working with a stale 
pointer.


Normally I wouldn't do this, but since this patch 
touches pretty much every function anyway, I fixed 
many deviations from the Python coding style.



----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-05-07 14:51

Message:
Logged In: YES 
user_id=31435

Na, assigning a bug is fine by me -- it helps to have 
*someone* feel guilty <wink>.  Assigning it doesn't mean it 
goes to the top of the assignee's heap, though.  I can't 
make time to look at it this week, so it's just as well 
that it got unassigned.

----------------------------------------------------------------------

Comment By: Scott Gilbert (xscott)
Date: 2002-05-07 08:55

Message:
Logged In: YES 
user_id=38318

Apparently assigning a patch is poor form.  My bad.

----------------------------------------------------------------------

Comment By: Scott Gilbert (xscott)
Date: 2002-05-05 00:27

Message:
Logged In: YES 
user_id=38318

Can I assign this to you or does it take admin privs?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=552438&group_id=5470