From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail-a.sr.ht; dkim=pass header.d=johnnyrichard.com header.i=@johnnyrichard.com Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [IPv6:2001:41d0:203:375::ad]) by mail-a.sr.ht (Postfix) with ESMTPS id 2C5422021E for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 27 Feb 2024 16:05:01 +0000 (UTC) Date: Tue, 27 Feb 2024 18:04:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1709049899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4sdxA66d51JUjn8NKhmkyTbF0tNhu+ssFXH47F9tdrY=; b=ftIIZ6n/eOyF4saGbTZNCqGsg34pIGpY1v4vGEdy8VVK72bDeX+5dBW3kKM2JSx61dkcuG Ylcn00nPSUjRj2WcbdE8cHmLnt6nIaxwb1+kQF+RfvilSi168JHH0r8yk0JTvOT9A8og6U j83jtn70bDpPO9RAWAj4TSZT9O8UnCfJoZBO37B+uJf2P5A1QJlfrZXBhacQsn8IJxHWOl UUyCRKYEtBdQNsGI1usca92ESRihwqdVgCfVHI26wWuMj20BB5yyYoAvSigrT1aKkdG6M0 QGcg3RDziIOIzfOibbDPyNeTokP1fMCFbnJ54pLCqp628HFsj5yJqlN8rX9p9Q== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Johnny Richard To: Carlos Maniero Cc: ~johnnyrichard/olang-devel@lists.sr.ht Subject: Re: [PATCH olang] cli: replace memory allocation malloc -> arena Message-ID: References: <20240222191007.78350-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-TUID: 8ROtnqLC0Jyo On Tue, Feb 27, 2024 at 12:44:47PM -0300, Carlos Maniero wrote: > > diff --git a/src/0c.c b/src/0c.c > > index 978b770..f0ac974 100644 > > --- a/src/0c.c > > +++ b/src/0c.c > 0c.c no longer exists > > > +#define ARENA_CAPACITY (1024 * 1024) > Can you add a TODO comment to us to remember to solve this issue in the > feature? We can both make a algorithm to predict how much memory we > gonna need or make arena expandable. Do you think the following fixup is good enough? ------->8------- Subject: [PATCH olang] fixup! cli: replace memory allocation malloc -> arena diff --git a/src/main.c b/src/main.c index f0ac974..2b2f12a 100644 --- a/src/main.c +++ b/src/main.c @@ -25,6 +25,7 @@ #include "lexer.h" #include "string_view.h" +// TODO: find a better solution to define the arena capacity #define ARENA_CAPACITY (1024 * 1024) typedef struct cli_args