[rrd-developers] Re: RRDs.xs malloc to multi-dimensional array

Alexandre CHERIF alexandre at neutrinos.org
Tue Aug 13 18:59:29 MEST 2002


Re,

Sorry the problem is not only in perl-shared...but in the lib too.

ex:
 rrd_fetch:149
    /* when was the realy last update of this file ? */

    if (((*ds_namv) = (char **) malloc(rrd.stat_head->ds_cnt * sizeof(char*)))==NULL){
        rrd_set_error("malloc fetch ds_namv array");
        rrd_free(&rrd);
        fclose(in_file);
        return(-1);
    }

    for(i=0;i<rrd.stat_head->ds_cnt;i++){
        if ((((*ds_namv)[i]) = malloc(sizeof(char) * DS_NAM_SIZE))==NULL){
<CUT>

   }

again a malloc in a loop..with this time fixed size, it might be interesting to 
rewrite this part of code i can handle if everybody think it's not useless.

Regard




-- 
Alexandre
==
Don't try and use this release for anything useful. We have made every effort to ensure that all
bits in this package are either 0 or 1. However, these bits may not be in the correct order and proportion. 
==

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list