RE: [english 100%] [PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned...
authorRobert Mast <beheerder@tekenbeetziekten.nl>
Wed, 13 Feb 2013 15:15:32 +0000 (16:15 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:36 +0000 (09:53 -0800)
a7/8c1d5cb7fe65cf13a2f8df14a544f8bbeb2aec [new file with mode: 0644]

diff --git a/a7/8c1d5cb7fe65cf13a2f8df14a544f8bbeb2aec b/a7/8c1d5cb7fe65cf13a2f8df14a544f8bbeb2aec
new file mode 100644 (file)
index 0000000..b0458d8
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <beheerder@tekenbeetziekten.nl>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 03913431FD6\r
+       for <notmuch@notmuchmail.org>; Wed, 13 Feb 2013 07:15:42 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Czk6-AiFDpLX for <notmuch@notmuchmail.org>;\r
+       Wed, 13 Feb 2013 07:15:41 -0800 (PST)\r
+Received: from srv047132.webreus.nl (srv047132.webreus.nl [46.235.47.132])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 0CAFC431FC9\r
+       for <notmuch@notmuchmail.org>; Wed, 13 Feb 2013 07:15:40 -0800 (PST)\r
+Received: (qmail 17519 invoked from network); 13 Feb 2013 16:15:39 +0100\r
+Received: from ip73-109-210-87.adsl2.static.versatel.nl (HELO PCvangebruike)\r
+       (87.210.109.73)\r
+       by srv047132.webreus.nl with SMTP; 13 Feb 2013 16:15:37 +0100\r
+From: "Robert Mast" <beheerder@tekenbeetziekten.nl>\r
+To: <notmuch@notmuchmail.org>\r
+References: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
+       <1360768303-4228-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
+In-Reply-To: <1360768303-4228-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
+Subject: RE: [english 100%] [PATCH] bitmap:improve memory usage using\r
+       CHAR_BITS and unsigned CHAR\r
+Date: Wed, 13 Feb 2013 16:15:32 +0100\r
+Message-ID: <007501ce09fc$f85e20d0$e91a6270$@nl>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain;\r
+       charset="UTF-8"\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Mailer: Microsoft Office Outlook 12.0\r
+Thread-Index: Ac4J/Hr6NuL3/WjCTt+Lnhvxo3iRWAAAGxUw\r
+Content-Language: nl\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 13 Feb 2013 15:15:42 -0000\r
+\r
+Somehow my comments don't get through... I'll try it another way.\r
+\r
+-----Oorspronkelijk bericht-----\r
+Van: Robert Mast [mailto:beheerder@tekenbeetziekten.nl]=20\r
+Verzonden: woensdag 13 februari 2013 16:12\r
+Aan: notmuch@notmuchmail.org\r
+CC: Robert Mast\r
+Onderwerp: [english 100%] [PATCH] bitmap:improve memory usage using =\r
+CHAR_BITS and unsigned CHAR\r
+\r
+diff --git a/lib/query.cc b/lib/query.cc index e9c1a2d..7381a54 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -39,12 +39,12 @@ typedef struct _notmuch_mset_messages {  } =\r
+notmuch_mset_messages_t;\r
+=20\r
+ struct _notmuch_doc_id_set {\r
+-    unsigned int *bitmap;\r
++    unsigned char *bitmap;\r
+     unsigned int bound;\r
+ };\r
+=20\r
+-#define DOCIDSET_WORD(bit) ((bit) / sizeof (unsigned int)) -#define =\r
+DOCIDSET_BIT(bit) ((bit) % sizeof (unsigned int))\r
++#define DOCIDSET_WORD(bit) ((bit) / CHAR_BIT) #define DOCIDSET_BIT(bit) =\r
+\r
++((bit) % CHAR_BIT)\r
+=20\r
+ struct visible _notmuch_threads {\r
+     notmuch_query_t *query;\r
+@@ -359,11 +359,11 @@ _notmuch_doc_id_set_init (void *ctx,\r
+                         GArray *arr)\r
+ {\r
+     unsigned int max =3D 0;\r
+-    unsigned int *bitmap;\r
++    unsigned char *bitmap;\r
+=20\r
+     for (unsigned int i =3D 0; i < arr->len; i++)\r
+       max =3D MAX(max, g_array_index (arr, unsigned int, i));\r
+-    bitmap =3D talloc_zero_array (ctx, unsigned int, 1 + max / sizeof =\r
+(*bitmap));\r
++    bitmap =3D talloc_zero_array (ctx, unsigned char, =\r
+DOCIDSET_WORD(max)=20\r
++ + 1);\r
+=20\r
+     if (bitmap =3D=3D NULL)\r
+       return FALSE;\r
+--\r
+1.7.9.5\r
+\r
+\r
+.\r
+\r