* Replacing malloc/memset with calloc
@ 2020-09-28 7:09 Aravind Machiry
2020-09-28 17:06 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: Aravind Machiry @ 2020-09-28 7:09 UTC (permalink / raw)
To: linux-bluetooth
Hello,
There are several places (at least in sdp.c) where `malloc` and
memset(,0,) pattern Is used. All these can be replaced with calloc for
efficiency.
Is there any specific reason why malloc/memset is preferred?
-Best,
Aravind
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Replacing malloc/memset with calloc
2020-09-28 7:09 Replacing malloc/memset with calloc Aravind Machiry
@ 2020-09-28 17:06 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2020-09-28 17:06 UTC (permalink / raw)
To: Aravind Machiry; +Cc: linux-bluetooth
Hi Aravind,
On Mon, Sep 28, 2020 at 12:12 AM Aravind Machiry <machiry@cs.ucsb.edu> wrote:
>
> Hello,
>
> There are several places (at least in sdp.c) where `malloc` and
> memset(,0,) pattern Is used. All these can be replaced with calloc for
> efficiency.
>
> Is there any specific reason why malloc/memset is preferred?
It just old code that no one bother updating so far, we do have a
macro called malloc0 which does call calloc though.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-28 17:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 7:09 Replacing malloc/memset with calloc Aravind Machiry
2020-09-28 17:06 ` Luiz Augusto von Dentz
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.