1 Return-Path: <jw+debian@jameswestby.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id BFA85429E25
\r
6 for <notmuch@notmuchmail.org>; Thu, 1 Dec 2011 15:25:45 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id iEemiEjpDvpL for <notmuch@notmuchmail.org>;
\r
16 Thu, 1 Dec 2011 15:25:45 -0800 (PST)
\r
17 Received: from jameswestby.net (jameswestby.net [89.145.97.141])
\r
18 (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 373D2431FD0
\r
21 for <notmuch@notmuchmail.org>; Thu, 1 Dec 2011 15:25:45 -0800 (PST)
\r
22 Received: from [74.220.184.116] (helo=dim.jameswestby.net)
\r
23 by jameswestby.net with esmtpa (Exim 4.69)
\r
24 (envelope-from <jw+debian@jameswestby.net>) id 1RWG0d-0006cP-SL
\r
25 for notmuch@notmuchmail.org; Thu, 01 Dec 2011 23:25:44 +0000
\r
26 Received: by dim.jameswestby.net (Postfix, from userid 1000)
\r
27 id 3CC1B5A4AE0; Thu, 1 Dec 2011 18:25:43 -0500 (EST)
\r
28 From: James Westby <jw+debian@jameswestby.net>
\r
29 To: notmuch@notmuchmail.org
\r
30 Subject: Re: [PATCH] python: Store pointers as c_void_p to keep references
\r
31 In-Reply-To: <1322781185-15923-1-git-send-email-jw+debian@jameswestby.net>
\r
32 References: <87pqg8b9hx.fsf@jameswestby.net>
\r
33 <1322781185-15923-1-git-send-email-jw+debian@jameswestby.net>
\r
34 User-Agent: Notmuch/0.6.1-1 (http://notmuchmail.org) Emacs/23.3.1
\r
35 (x86_64-pc-linux-gnu)
\r
36 Date: Thu, 01 Dec 2011 18:25:43 -0500
\r
37 Message-ID: <87k46fc1s8.fsf@jameswestby.net>
\r
39 Content-Type: text/plain; charset=us-ascii
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Thu, 01 Dec 2011 23:25:45 -0000
\r
54 On Thu, 1 Dec 2011 18:13:05 -0500, James Westby <jw+debian@jameswestby.net> wrote:
\r
55 > From: James Westby <james.westby@linaro.org>
\r
57 > ctypes doesn't return c_void_p return values as that, it returns them as
\r
58 > 32-bit integers instead. This has two problems:
\r
60 > 1 - On 64-bit machines anything higher than the max 32-bit integer
\r
61 > will overflow when passed back in to another function expecting,
\r
62 > a pointer giving the wrong value.
\r
64 > 2 - If the value isn't stored as a pointer then the memory can be
\r
65 > re-used and so the object will be corrupted.
\r
67 > The fix for both of these is to store the values as pointers.
\r
69 http://osdir.com/ml/python.ctypes/2006-12/msg00048.html states that this
\r
70 is expected behaviour of ctypes.
\r