All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
To: ofono@ofono.org
Subject: Re: [PATCHv3 1/5] Mobile broadband provider info plugin
Date: Tue, 16 Aug 2011 17:11:43 +0300	[thread overview]
Message-ID: <4E4A7A9F.8050208@intel.com> (raw)
In-Reply-To: <4E44CE68.7040404@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

Hello Denis,

On 08/12/2011 09:55 AM, Denis Kenzior wrote:
>> +static struct ofono_gprs_provision_data *apn_try_new(struct parser_data *data)
>> +{
>> +	void *p;
>> +
>> +	p = g_try_realloc(*data->settings,
>> +				sizeof(struct ofono_gprs_provision_data) *
>> +				(data->count + 1));
>> +	if (p == NULL)
>> +		return NULL;
>> +
>> +	*data->settings = p;
>> +
>> +	data->context = *data->settings + data->count++;
>> +
>> +	memset(data->context, 0, sizeof(struct ofono_gprs_provision_data));
>
> This seems like a really big hammer.  We have 3 settings we're likely to
> provision, internet, wap, mms.  The function runs synchronously and
> oFono is not threaded.  So in theory you can allocate the context
> information statically and only copy it to the caller once you have
> completed the parser.

Hmm, statically allocated array of settings was in the previous version. Then 
the wish was to make it dynamic and to use realloc. Can we settle on an approach 
here?

Regards,
Oleg
-- 
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

  reply	other threads:[~2011-08-16 14:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 12:25 [PATCHv3 0/5] Mobile broadband provider info plugin Oleg Zhurakivskyy
2011-08-05 12:25 ` [PATCHv3 1/5] " Oleg Zhurakivskyy
2011-08-12  6:55   ` Denis Kenzior
2011-08-16 14:11     ` Oleg Zhurakivskyy [this message]
2011-08-18 18:37       ` Denis Kenzior
2011-08-05 12:25 ` [PATCHv3 2/5] GPRS context plan support Oleg Zhurakivskyy
2011-08-12  6:43   ` Denis Kenzior
2011-08-05 12:26 ` [PATCHv3 3/5] GPRS provisioning data " Oleg Zhurakivskyy
2011-08-05 12:26 ` [PATCHv3 4/5] Mobile broadband provider info plugin autoconf support Oleg Zhurakivskyy
2011-08-05 12:26 ` [PATCHv3 5/5] Mobile broadband provider info plugin makefile changes Oleg Zhurakivskyy

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=4E4A7A9F.8050208@intel.com \
    --to=oleg.zhurakivskyy@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.