Exemple #1
0
mbinit()
{
	int s;

	s = splimp();
	if (m_clalloc(4096/CLBYTES, MPG_MBUFS, M_DONTWAIT) == 0)
		goto bad;
	if (m_clalloc(4096/CLBYTES, MPG_CLUSTERS, M_DONTWAIT) == 0)
		goto bad;
	splx(s);
	return;
bad:
	panic("mbinit");
}
Exemple #2
0
void
mbinit()
{
    int s;

    s = splimp();
    if (m_clalloc(max(4096/CLBYTES, 1), M_DONTWAIT) == 0)
        goto bad;
    splx(s);
    return;
bad:
    panic("mbinit");
}
Exemple #3
0
void
mbinit()
{
	int s;

#if CLBYTES < 4096
#define NCL_INIT	(4096/CLBYTES)
#else
#define NCL_INIT	1
#endif
	s = splimp();
	if (m_clalloc(NCL_INIT, M_DONTWAIT) == 0)
		goto bad;
	splx(s);
	return;
bad:
	panic("mbinit");
}
Exemple #4
0
BOOL
mbinit(void)
{
  spl_t s;
#if defined(__AROS__)
D(bug("[AROSTCP](uipc_mbuf.c) mbinit()\n"));
#endif

  /*
   * Return success if already initialized
   */
  if (initialized)
    return TRUE;

  s = splimp();
  /*
   * Initialize the list headers to NULL
   */
  mfree = NULL;
  mclfree = NULL;

  /*
   * Preallocate some mbufs and mbuf clusters.
   */
  initialized = 
    (m_alloc(mbconf.initial_mbuf_chunks * mbconf.mbufchunk, M_WAIT)
     && m_clalloc(mbconf.clusterchunk, M_WAIT));

  splx(s);
  
  if (!initialized) {
#if defined(__AROS__)
D(bug("[AROSTCP](uipc_mbuf.c) mbinit: Failed to allocate memory!\n"));
#endif
    __log(LOG_ERR, "mbinit: Failed to allocate memory.");
    mbdeinit();
  }
  return (initialized);
}