From: Stephen Hemminger <stephen@networkplumber.org>
To: Euan Bourke <euan.bourke@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [PATCH 24.03 v2 1/5] arg_parser: new library for command line parsing
Date: Wed, 29 Nov 2023 14:14:13 -0800 [thread overview]
Message-ID: <20231129141413.73faa6c8@hermes.local> (raw)
In-Reply-To: <20231128140745.595481-2-euan.bourke@intel.com>
On Tue, 28 Nov 2023 14:07:41 +0000
Euan Bourke <euan.bourke@intel.com> wrote:
> +int
> +rte_parse_corelist(const char *corelist, uint16_t *cores, uint32_t cores_len)
> +{
> + int32_t min = -1;
> + char *end = NULL;
> +
> + struct core_bits *mask = malloc(sizeof(struct core_bits));
> + if (mask == NULL)
> + return -1;
> + memset(mask, 0, sizeof(struct core_bits));
> +
The structure is not variable size, and small, why bother using malloc().
Just use on stack structure.
next prev parent reply other threads:[~2023-11-29 22:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 16:45 [PATCH 24.03 0/4] add new command line argument parsing library Euan Bourke
2023-11-22 16:45 ` [PATCH 24.03 1/4] arg_parser: new library for command line parsing Euan Bourke
2023-11-23 15:50 ` Bruce Richardson
2023-11-22 16:45 ` [PATCH 24.03 2/4] arg_parser: add new coremask parsing API Euan Bourke
2023-11-23 15:55 ` Bruce Richardson
2023-11-22 16:45 ` [PATCH 24.03 3/4] eal: add support for new arg parsing library Euan Bourke
2023-11-22 16:45 ` [PATCH 24.03 4/4] dlb2: add new arg parsing library API support Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 0/5] add new command line argument parsing library Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 1/5] arg_parser: new library for command line parsing Euan Bourke
2023-11-29 22:12 ` Stephen Hemminger
2023-11-29 22:12 ` Stephen Hemminger
2023-11-29 22:14 ` Stephen Hemminger [this message]
2023-11-30 8:59 ` Bruce Richardson
2023-11-28 14:07 ` [PATCH 24.03 v2 2/5] arg_parser: add new coremask parsing API Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 3/5] eal: add support for new arg parsing library Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 4/5] eal: update to service core related parsers Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 5/5] event/dlb2: add new arg parsing library API support Euan Bourke
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=20231129141413.73faa6c8@hermes.local \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=euan.bourke@intel.com \
--cc=thomas@monjalon.net \
/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.