[ofa-general] [PATCH 1/4] multicast multiplexing - definitions for new data types, and infrastructure functions

Hal Rosenstock hal.rosenstock at gmail.com
Mon Jul 20 07:17:47 PDT 2009


On Sun, Jul 19, 2009 at 11:15 AM, Sasha Khapyorsky<sashak at voltaire.com> wrote:
> On 09:38 Thu 16 Jul     , Hal Rosenstock wrote:
>> > +static osm_mgrp_port_t *osm_mgrp_port_new(ib_net64_t port_guid)
>> > +{
>> > + ?? ?? ?? osm_mgrp_port_t *p_mgrp_port =
>> > + ?? ?? ?? ?? ?? (osm_mgrp_port_t *) malloc(sizeof(osm_mgrp_port_t));
>> > + ?? ?? ?? if (!p_mgrp_port) {
>> > + ?? ?? ?? ?? ?? ?? ?? return NULL;
>> > + ?? ?? ?? }
>> > + ?? ?? ?? memset(p_mgrp_port, 0, sizeof(*p_mgrp_port));
>>
>> Minor - could use calloc rather than malloc/memset here.
>
> BTW what is the clear benefit?

It's minor but it does save the overhead of an extra call into library.

-- Hal

> Sasha



More information about the general mailing list