From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F38D443407; Wed, 29 Nov 2023 23:14:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E31A0402E6; Wed, 29 Nov 2023 23:14:17 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 33063402E1 for ; Wed, 29 Nov 2023 23:14:16 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6cdd4aab5f5so281308b3a.3 for ; Wed, 29 Nov 2023 14:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701296055; x=1701900855; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ckyVUInoYbceViJggNn/hgyxDYHFLZvscV52M/ZivTQ=; b=nd2bkTQxRPCFODgfrWh4nXco1eh8X6azyYd9Ob3KNf99MPJ/6dyp0c21dSCqkPidtA Z1lNernHjVJdWjlYLrsN0nvliQ8NRZnVblKE7Z7IvI+aV1yiOnzLUpYNcZ66LfJMuUpP PLzOc4arV2KNhDnWHOPol1iEc41jL/5zvciUUzP3T0ptbnEGG5n8zLDeN7PAp1wgW7a0 ygqmIULBS6Pm50hhIcHpC2bB+jcyfidAggUjFqD3xxhU9/edxNLYkBeglQC1wNs0TLZ4 BIUI0FfPPgEzzaCr8WwSU/TJgBa9hsTIc2rKbHHnT3dsbhdXNPVIpUpDRiIEM4FDcCp3 vg6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701296055; x=1701900855; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ckyVUInoYbceViJggNn/hgyxDYHFLZvscV52M/ZivTQ=; b=SQpnCF08AzdwqAESvREx+BXEvC6vaW5S924JR4iCsLikJ7HkIaGjwBXuY9Rb3XWtts EKHgljhmVsR0BIhIUicJqaF12aI3k2QA/HX1KUdDcVmJNGzqJljYKOQkS4TCoFiNZEOH la3vdY7+t+OOjPIIrqdlfsoSVxcQqbQOjKA1lXkul+5cAaDWYTsX/N6BrfhjDOnK5ggi TP3RZim1DN+70/uc/8LZf9I79YMS5CaVsOAerRy0u6Dy7NQxOhxVINGuLoJu4OtVmu2G MMvr65cklv5jcnKBoNwQCIA8XVYWLNvk+TFeT2nv4MIBcpvNiTjoQ6Tg+ruB9qIjdH70 WBLQ== X-Gm-Message-State: AOJu0YxMMUDcvCkdGUeWpeffTXvDxj+12ZBQlvVO5froW0DFudFWMlQB QlsnfZg+89E/QPXlLaHS/E6tdg== X-Google-Smtp-Source: AGHT+IHEcoVmZJhzMRlSfbMc/MWdOufJYrYE9rWzqZLR3x26N5FBEV+iKi24CRaufw3r1h8ZIyMW6g== X-Received: by 2002:a05:6a00:2188:b0:6cb:4c60:7328 with SMTP id h8-20020a056a00218800b006cb4c607328mr25403328pfi.23.1701296055291; Wed, 29 Nov 2023 14:14:15 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id n12-20020a056a0007cc00b006cbb80e4577sm2049508pfu.210.2023.11.29.14.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:14:15 -0800 (PST) Date: Wed, 29 Nov 2023 14:14:13 -0800 From: Stephen Hemminger To: Euan Bourke Cc: dev@dpdk.org, Thomas Monjalon , Bruce Richardson Subject: Re: [PATCH 24.03 v2 1/5] arg_parser: new library for command line parsing Message-ID: <20231129141413.73faa6c8@hermes.local> In-Reply-To: <20231128140745.595481-2-euan.bourke@intel.com> References: <20231122164550.3873633-1-euan.bourke@intel.com> <20231128140745.595481-1-euan.bourke@intel.com> <20231128140745.595481-2-euan.bourke@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 28 Nov 2023 14:07:41 +0000 Euan Bourke 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.