1 Return-Path: <beheerder@tekenbeetziekten.nl>
\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 C0359431FBF
\r
6 for <notmuch@notmuchmail.org>; Mon, 11 Feb 2013 10:24:35 -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 bU6ZgLe7Gnhw for <notmuch@notmuchmail.org>;
\r
16 Mon, 11 Feb 2013 10:24:34 -0800 (PST)
\r
17 Received: from srv047132.webreus.nl (srv047132.webreus.nl [46.235.47.132])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id C2A6D431FBC
\r
21 for <notmuch@notmuchmail.org>; Mon, 11 Feb 2013 10:24:28 -0800 (PST)
\r
22 Received: (qmail 21948 invoked from network); 10 Feb 2013 18:24:27 +0100
\r
23 Received: from ip73-109-210-87.adsl2.static.versatel.nl (HELO linux2.foo)
\r
25 by srv047132.webreus.nl with SMTP; 10 Feb 2013 18:24:27 +0100
\r
26 From: Robert Mast <beheerder@tekenbeetziekten.nl>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: [PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned CHAR
\r
29 Date: Sun, 10 Feb 2013 18:24:16 +0100
\r
30 Message-Id: <1360517056-7066-1-git-send-email-beheerder@tekenbeetziekten.nl>
\r
31 X-Mailer: git-send-email 1.7.9.5
\r
32 In-Reply-To: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl>
\r
33 References: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl>
\r
34 Cc: Robert Mast <beheerder@tekenbeetziekten.nl>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Mon, 11 Feb 2013 18:24:36 -0000
\r
49 A little bug-fix to learn how to contribute to nutmuch, this time a combined commit with git rebase to provide one patch from 15.1.
\r
51 lib/query.cc | 10 +++++-----
\r
52 1 file changed, 5 insertions(+), 5 deletions(-)
\r
54 diff --git a/lib/query.cc b/lib/query.cc
\r
55 index e9c1a2d..7381a54 100644
\r
58 @@ -39,12 +39,12 @@ typedef struct _notmuch_mset_messages {
\r
59 } notmuch_mset_messages_t;
\r
61 struct _notmuch_doc_id_set {
\r
62 - unsigned int *bitmap;
\r
63 + unsigned char *bitmap;
\r
67 -#define DOCIDSET_WORD(bit) ((bit) / sizeof (unsigned int))
\r
68 -#define DOCIDSET_BIT(bit) ((bit) % sizeof (unsigned int))
\r
69 +#define DOCIDSET_WORD(bit) ((bit) / CHAR_BIT)
\r
70 +#define DOCIDSET_BIT(bit) ((bit) % CHAR_BIT)
\r
72 struct visible _notmuch_threads {
\r
73 notmuch_query_t *query;
\r
74 @@ -359,11 +359,11 @@ _notmuch_doc_id_set_init (void *ctx,
\r
77 unsigned int max = 0;
\r
78 - unsigned int *bitmap;
\r
79 + unsigned char *bitmap;
\r
81 for (unsigned int i = 0; i < arr->len; i++)
\r
82 max = MAX(max, g_array_index (arr, unsigned int, i));
\r
83 - bitmap = talloc_zero_array (ctx, unsigned int, 1 + max / sizeof (*bitmap));
\r
84 + bitmap = talloc_zero_array (ctx, unsigned char, DOCIDSET_WORD(max) + 1);
\r