From: Gustavo F. Padovan <padovan@profusion.mobi>
To: ofono@ofono.org
Subject: Re: [PATCH 2/4] bluetooth: use GSList instead of GHashTable to store adapter path/address
Date: Thu, 27 Jan 2011 14:19:25 -0200 [thread overview]
Message-ID: <20110127161925.GC2163@joana> (raw)
In-Reply-To: <4D4190D5.3010007@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]
Hi Frederic,
* Frederic Danis <frederic.danis@linux.intel.com> [2011-01-27 16:35:49 +0100]:
> Le 27/01/2011 16:24, Marcel Holtmann a écrit :
> > Hi Fred,
> >
> >>>> plugins/bluetooth.c | 86 +++++++++++++++++++++++++++++++++++++++++++-------
> >>>> 1 files changed, 74 insertions(+), 12 deletions(-)
> >>>>
> >>>> diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
> >>>> index e59bd31..4da662a 100644
> >>>> --- a/plugins/bluetooth.c
> >>>> +++ b/plugins/bluetooth.c
> >>>> @@ -39,9 +39,14 @@
> >>>>
> >>>> static DBusConnection *connection;
> >>>> static GHashTable *uuid_hash = NULL;
> >>>> -static GHashTable *adapter_address_hash = NULL;
> >>>> +static GSList *adapter_list = NULL;
> >>>> static gint bluetooth_refcount;
> >>>>
> >>>> +struct adapter_address {
> >>>> + char *adapter;
> >>>> + char *address;
> >>>> +};
> >>>> +
> >>>
> >>> why are we doing this exactly with a list now instead of a hash table. I
> >>> don't see the point here.
> >>>
> >>
> >> In patch 4, I need to find the adapter path (for the incoming
> >> connection) from its address to call the authorization method.
> >>
> >> So, this is why I change to GSList.
> >
> > you can as easily walk a GHashTable than you can walk a GSList. So why
> > not do that instead of moving everything to a list.
>
> I think that find a key from its value may use more cpu from HashTable
> than from GSList. If you want I can remove this and only use HashTable.
Please remove it and use the hashtable.
--
Gustavo F. Padovan
http://profusion.mobi
next prev parent reply other threads:[~2011-01-27 16:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 15:05 [PATCH v2 0/4] bluetooth: Add bluetooth server support =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-01-27 15:05 ` [PATCH 1/4] bluetooth: only use bluetooth_refcount in bluetooth_ref/bluetooth_unref =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-01-27 15:12 ` Marcel Holtmann
2011-01-27 15:25 ` Frederic Danis
2011-01-27 16:17 ` Gustavo F. Padovan
2011-01-27 16:18 ` Marcel Holtmann
2011-01-27 15:05 ` [PATCH 2/4] bluetooth: use GSList instead of GHashTable to store adapter path/address =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-01-27 15:13 ` Marcel Holtmann
2011-01-27 15:22 ` Frederic Danis
2011-01-27 15:24 ` Marcel Holtmann
2011-01-27 15:35 ` Frederic Danis
2011-01-27 16:19 ` Gustavo F. Padovan [this message]
2011-01-27 15:05 ` [PATCH 3/4] bluetooth: Add bluetooth server support =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-01-27 16:26 ` Gustavo F. Padovan
2011-01-27 16:32 ` Frederic Danis
2011-01-27 15:05 ` [PATCH 4/4] bluetooth: add Bluetooth service authorization support =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110127161925.GC2163@joana \
--to=padovan@profusion.mobi \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox