This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

m_clalloc(ncl, nowait),whether ncl will be too large to alloc?



m_clalloc(ncl, nowait),whether ncl will be too large to alloc?
when this occur,


m_clalloc(ncl, nowait)
register int ncl;
int nowait;
{
#ifdef __ECOS
caddr_t p;
int i;

if (ncl != 1) {
panic("Allocate multiple clusters!");
}
p = (caddr_t)cyg_net_cluster_alloc();
if (p == NULL) {
m_reclaim();
return (mclfree != NULL);
}
for (i = 0; i < ncl; i++) {//DANGER!
((union mcluster *)p)->mcl_next = mclfree;
mclfree = (union mcluster *)p;
p += MCLBYTES;
mbstat.m_clfree++;
}
mbstat.m_clusters += ncl;
return (1);



p += MCLBYTES maybe overflowed!
right?


_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn/

--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]