亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? malloc.c

?? GNU Sed GNU Sed GNU Sed
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
     Both the beginning of the header and the beginning of the
     block should be on an eight byte boundary.  */
#ifdef SUNOS_LOCALTIME_BUG
  if (n < 16)
    n = 16;
#endif
  nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
  {
    register unsigned int   shiftr = (nbytes - 1) >> 2;

    while (shiftr >>= 1)
      nunits++;
  }

  /* In case this is reentrant use of malloc from signal handler,
     pick a block size that no other malloc level is currently
     trying to allocate.  That's the easiest harmless way not to
     interfere with the other level of execution.  */
  while (busy[nunits])
    nunits++;
  busy[nunits] = 1;

  /* If there are no blocks of the appropriate size, go get some */
  /* COULD SPLIT UP A LARGER BLOCK HERE ... ACT */
  if (nextf[nunits] == 0)
    morecore (nunits);

  /* Get one block off the list, and set the new list head */
  if ((p = nextf[nunits]) == 0)
    {
      busy[nunits] = 0;

DbgPrint("Malloc failing allocation of %d bytes\n", n);

      return 0;
    }
  nextf[nunits] = CHAIN (p);
  busy[nunits] = 0;

  /* Check for free block clobbered */
  /* If not for this check, we would gobble a clobbered free chain ptr */
  /* and bomb out on the NEXT allocate of this size block */
  if (p -> mh_alloc != ISFREE || p -> mh_index != nunits)
#ifdef rcheck
    botch ("block on free list clobbered");
#else /* not rcheck */
    abort ();
#endif /* not rcheck */

  /* Fill in the info, and if range checking, set up the magic numbers */
  p -> mh_alloc = ISALLOC;
#ifdef rcheck
  p -> mh_nbytes = n;
  p -> mh_magic4 = MAGIC4;
  {
    /* Get the location n after the beginning of the user's space.  */
    register char *m = (char *) p + ((sizeof *p + 7) & ~7) + n;

    *m++ = MAGIC1, *m++ = MAGIC1, *m++ = MAGIC1, *m = MAGIC1;
  }
#else /* not rcheck */
  p -> mh_size = n;
#endif /* not rcheck */
#ifdef MSTATS
  nmalloc[nunits]++;
  nmal++;
#endif /* MSTATS */
  return (char *) p + ((sizeof *p + 7) & ~7);
}

free (mem)
     char *mem;
{
  register struct mhead *p;
  {
    register char *ap = mem;

    if (ap == 0)
      return;

    p = (struct mhead *) (ap - ((sizeof *p + 7) & ~7));
    if (p -> mh_alloc == ISMEMALIGN)
      {
	ap -= p->mh_size;
	p = (struct mhead *) (ap - ((sizeof *p + 7) & ~7));
      }

#ifndef rcheck
    if (p -> mh_alloc != ISALLOC)
      abort ();

#else /* rcheck */
    if (p -> mh_alloc != ISALLOC)
      {
	if (p -> mh_alloc == ISFREE)
	  botch ("free: Called with already freed block argument\n");
	else
	  botch ("free: Called with bad argument\n");
      }

    ASSERT (p -> mh_magic4 == MAGIC4);
    ap += p -> mh_nbytes;
    ASSERT (*ap++ == MAGIC1); ASSERT (*ap++ == MAGIC1);
    ASSERT (*ap++ == MAGIC1); ASSERT (*ap   == MAGIC1);
#endif /* rcheck */
  }
  {
    register int nunits = p -> mh_index;

    ASSERT (nunits <= 29);
    p -> mh_alloc = ISFREE;

    /* Protect against signal handlers calling malloc.  */
    busy[nunits] = 1;
    /* Put this block on the free list.  */
    CHAIN (p) = nextf[nunits];
    nextf[nunits] = p;
    busy[nunits] = 0;

#ifdef MSTATS
    nmalloc[nunits]--;
    nfre++;
#endif /* MSTATS */
  }
}

char *
realloc (mem, n)
     char *mem;
     register unsigned n;
{
  register struct mhead *p;
  register unsigned int tocopy;
  register unsigned int nbytes;
  register int nunits;

  if (mem == 0)
    return malloc (n);
  p = (struct mhead *) (mem - ((sizeof *p + 7) & ~7));
  nunits = p -> mh_index;
  ASSERT (p -> mh_alloc == ISALLOC);
#ifdef rcheck
  ASSERT (p -> mh_magic4 == MAGIC4);
  {
    register char *m = mem + (tocopy = p -> mh_nbytes);
    ASSERT (*m++ == MAGIC1); ASSERT (*m++ == MAGIC1);
    ASSERT (*m++ == MAGIC1); ASSERT (*m   == MAGIC1);
  }
#else /* not rcheck */
  if (p -> mh_index >= 13)
    tocopy = (1 << (p -> mh_index + 3)) - ((sizeof *p + 7) & ~7);
  else
    tocopy = p -> mh_size;
#endif /* not rcheck */

  /* See if desired size rounds to same power of 2 as actual size. */
  nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;

  /* If ok, use the same block, just marking its size as changed.  */
  if (nbytes > (4 << nunits) && nbytes <= (8 << nunits))
    {
#ifdef rcheck
      register char *m = mem + tocopy;
      *m++ = 0;  *m++ = 0;  *m++ = 0;  *m++ = 0;
      p-> mh_nbytes = n;
      m = mem + n;
      *m++ = MAGIC1;  *m++ = MAGIC1;  *m++ = MAGIC1;  *m++ = MAGIC1;
#else /* not rcheck */
      p -> mh_size = n;
#endif /* not rcheck */
      return mem;
    }

  if (n < tocopy)
    tocopy = n;
  {
    register char *new;

    if ((new = malloc (n)) == 0)
      return 0;
    memcpy(new, mem, tocopy);
    free (mem);
    return new;
  }
}

/* This is in case something linked with Emacs calls calloc.  */

char *
calloc (num, size)
     unsigned num, size;
{
  register char *mem;

  num *= size;
  mem = malloc (num);
  if (mem != 0)
    memset(mem, 0, num);
  return mem;
}

/* This is in case something linked with Emacs calls cfree.  */

cfree (mem)
     char *mem;
{
  return free (mem);
}

#ifndef VMS

char *
memalign (alignment, size)
     unsigned alignment, size;
{
  register char *ptr = malloc (size + alignment);
  register char *aligned;
  register struct mhead *p;

  if (ptr == 0)
    return 0;
  /* If entire block has the desired alignment, just accept it.  */
  if (((int) ptr & (alignment - 1)) == 0)
    return ptr;
  /* Otherwise, get address of byte in the block that has that alignment.  */
  aligned = (char *) (((int) ptr + alignment - 1) & -alignment);

  /* Store a suitable indication of how to free the block,
     so that free can find the true beginning of it.  */
  p = (struct mhead *) (aligned - ((7 + sizeof (struct mhead)) & ~7));
  p -> mh_size = aligned - ptr;
  p -> mh_alloc = ISMEMALIGN;
  return aligned;
}

#ifndef HPUX
/* This runs into trouble with getpagsz on HPUX.
   Patching out seems cleaner than the ugly fix needed.  */
char *
valloc (size)
{
  return memalign (getpagsz (), size);
}
#endif /* not HPUX */
#endif /* not VMS */

#ifdef MSTATS
/* Return statistics describing allocation of blocks of size 2**n. */

struct mstats_value
  {
    int blocksize;
    int nfree;
    int nused;
  };

struct mstats_value
malloc_stats (size)
     int size;
{
  struct mstats_value v;
  register int i;
  register struct mhead *p;

  v.nfree = 0;

  if (size < 0 || size >= 30)
    {
      v.blocksize = 0;
      v.nused = 0;
      return v;
    }

  v.blocksize = 1 << (size + 3);
  v.nused = nmalloc[size];

  for (p = nextf[size]; p; p = CHAIN (p))
    v.nfree++;

  return v;
}
int
malloc_mem_used ()
{
  int i;
  int size_used;

  size_used = 0;
  
  for (i = 0; i < 30; i++)
    {
      int allocation_size = 1 << (i + 3);
      struct mhead *p;
      
      size_used += nmalloc[i] * allocation_size;
    }

  return size_used;
}

int 
malloc_mem_free ()
{
  int i;
  int size_unused;

  size_unused = 0;
  
  for (i = 0; i < 30; i++)
    {
      int allocation_size = 1 << (i + 3);
      struct mhead *p;
      
      for (p = nextf[i]; p ; p = CHAIN (p))
	size_unused += allocation_size;
    }

  return size_unused;
}
#endif /* MSTATS */

/*
 *	This function returns the total number of bytes that the process
 *	will be allowed to allocate via the sbrk(2) system call.  On
 *	BSD systems this is the total space allocatable to stack and
 *	data.  On USG systems this is the data space only.
 */

#ifdef WINDOWSNT
get_lim_data ()
{
  lim_data = 0x7fffffff;	// this is the MAX...
}
#else /* !WINDOWSNT */
#ifdef USG

get_lim_data ()
{
  extern long ulimit ();
    
#ifdef ULIMIT_BREAK_VALUE
  lim_data = ULIMIT_BREAK_VALUE;
#else
  lim_data = ulimit (3, 0);
#endif

  lim_data -= (long) data_space_start;
}

#else /* not USG */
#if defined (BSD4_1) || defined (VMS)

get_lim_data ()
{
  lim_data = vlimit (LIM_DATA, -1);
}

#else /* not BSD4_1 and not VMS */

get_lim_data ()
{
  struct rlimit XXrlimit;

  getrlimit (RLIMIT_DATA, &XXrlimit);
#ifdef RLIM_INFINITY
  lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
#else
  lim_data = XXrlimit.rlim_cur;	/* soft limit */
#endif
}

#endif /* not BSD4_1 and not VMS */
#endif /* not USG */
#endif /* !WINDOWSNT */

#ifdef VMS
/* There is a problem when dumping and restoring things on VMS. Calls
 * to SBRK don't necessarily result in contiguous allocation. Dumping
 * doesn't work when it isn't. Therefore, we make the initial
 * allocation contiguous by allocating a big chunk, and do SBRKs from
 * there. Once Emacs has dumped there is no reason to continue
 * contiguous allocation, malloc doesn't depend on it.
 *
 * There is a further problem of using brk and sbrk while using VMS C
 * run time library routines malloc, calloc, etc. The documentation
 * says that this is a no-no, although I'm not sure why this would be
 * a problem. In any case, we remove the necessity to call brk and
 * sbrk, by calling calloc (to assure zero filled data) rather than
 * sbrk.
 *
 * VMS_ALLOCATION_SIZE is the size of the allocation array. This
 * should be larger than the malloc size before dumping. Making this
 * too large will result in the startup procedure slowing down since
 * it will require more space and time to map it in.
 *
 * The value for VMS_ALLOCATION_SIZE in the following define was determined
 * by running emacs linked (and a large allocation) with the debugger and
 * looking to see how much storage was used. The allocation was 201 pages,
 * so I rounded it up to a power of two.
 */
#ifndef VMS_ALLOCATION_SIZE
#define VMS_ALLOCATION_SIZE	(512*256)
#endif

/* Use VMS RTL definitions */
#undef sbrk
#undef brk
#undef malloc
int vms_out_initial = 0;
char vms_initial_buffer[VMS_ALLOCATION_SIZE];
static char *vms_current_brk = vms_initial_buffer;
static char *vms_end_brk = &vms_initial_buffer[VMS_ALLOCATION_SIZE-1];

#include <stdio.h>

char *
sys_sbrk (incr)
     int incr;
{
  char *sbrk(), *temp, *ptr;

  if (vms_out_initial)
    {
      /* out of initial allocation... */
      if (!(temp = (char*) malloc (incr)))
      temp = (char *) -1;
    }
  else
    {
      /* otherwise, go out of our area */
      ptr = vms_current_brk + incr; /* new current_brk */
      if (ptr <= vms_end_brk)
	{
	  temp = vms_current_brk;
	  vms_current_brk = ptr;
	}
      else
      {
        vms_out_initial = 1;  /* mark as out of initial allocation */
        if (!(temp = (char*) malloc (incr)))
          temp = (char *) -1;
      }
    }
  return temp;
}
#endif /* VMS */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品国产免大香伊| 国产精品一区二区你懂的| 国产网站一区二区| 日韩区在线观看| 欧美日韩视频在线一区二区| 91久久久免费一区二区| 色先锋久久av资源部| 色综合久久久久久久久| 91久久一区二区| 7777精品伊人久久久大香线蕉| 欧美日本在线播放| 精品日韩99亚洲| 欧美激情综合在线| 亚洲天堂2016| 亚洲高清免费一级二级三级| 日韩电影在线观看一区| 国产一区二区调教| 91在线国内视频| 555夜色666亚洲国产免| 久久日韩粉嫩一区二区三区 | 国产精品网曝门| 亚洲品质自拍视频| 亚洲国产成人porn| 国产一区二区伦理| 91色九色蝌蚪| 日韩一级片在线播放| 久久九九久久九九| 亚洲国产一区二区a毛片| 麻豆精品一区二区av白丝在线| 国产一区二区三区免费在线观看| 豆国产96在线|亚洲| 欧美三级在线看| 国产午夜久久久久| 亚洲一区二区三区中文字幕| 久久国产精品99久久人人澡| 成人av电影在线| 91麻豆精品国产91久久久使用方法 | 国产精品久久久久精k8| 无码av免费一区二区三区试看| 美女视频黄免费的久久| www.66久久| xnxx国产精品| 午夜久久久影院| 波多野结衣精品在线| 91精品国产综合久久小美女| 国产精品久久久99| 久久国产剧场电影| 欧美日韩国产首页| ...av二区三区久久精品| 六月丁香婷婷久久| 欧美三级日韩三级| 亚洲视频 欧洲视频| 国产一区二区伦理| 日韩女优视频免费观看| 亚洲午夜久久久久久久久电影网| 懂色av一区二区三区蜜臀| 欧美岛国在线观看| 午夜国产精品一区| 在线观看国产日韩| 伊人夜夜躁av伊人久久| 高潮精品一区videoshd| www国产精品av| 免费视频最近日韩| 日韩三级在线免费观看| 日韩精品高清不卡| 51午夜精品国产| 午夜久久久影院| 精品视频一区二区三区免费| 亚洲精品国产一区二区三区四区在线| 国产高清在线精品| 国产午夜精品在线观看| 国产一区二区三区在线观看精品| 精品三级在线看| 国内久久婷婷综合| 亚洲精品一线二线三线| 国内精品视频一区二区三区八戒| 日韩欧美一区二区在线视频| 麻豆精品视频在线观看视频| 日韩欧美国产成人一区二区| 久久99九九99精品| 欧美精品一区二区三区在线播放| 紧缚奴在线一区二区三区| 欧美成人激情免费网| 国产一区二区三区免费看| 中文字幕乱码一区二区免费| 懂色中文一区二区在线播放| 国产精品女人毛片| 91激情五月电影| 丝袜诱惑制服诱惑色一区在线观看 | 午夜欧美大尺度福利影院在线看| 欧美另类久久久品| 激情综合网最新| 国产精品日产欧美久久久久| 91无套直看片红桃| 天天色天天操综合| 久久久久久亚洲综合影院红桃| 国产suv精品一区二区三区 | 97精品国产露脸对白| 中文字幕在线播放不卡一区| 精品国产成人系列| 精品国产精品网麻豆系列| 国产一区高清在线| 夜夜亚洲天天久久| 欧美日韩一区二区在线视频| 日韩精品欧美精品| 国产欧美一区二区精品久导航| 波波电影院一区二区三区| 一区二区免费在线播放| 精品日韩一区二区| 一本久久综合亚洲鲁鲁五月天| 天堂在线一区二区| 中文字幕第一区综合| 欧美日韩免费视频| 国产成人免费视| 亚洲电影第三页| 国产欧美精品一区二区色综合朱莉| 在线观看精品一区| 国产宾馆实践打屁股91| 日韩成人午夜电影| 樱桃视频在线观看一区| 久久亚洲综合av| 欧美伦理视频网站| 一本色道久久综合狠狠躁的推荐| 日韩不卡一区二区三区| 亚洲精品videosex极品| 中文字幕欧美日本乱码一线二线| 91精品一区二区三区久久久久久| 成人黄色综合网站| 国产一区二区三区免费观看| 日本午夜精品一区二区三区电影| 中文字幕在线一区二区三区| 26uuu色噜噜精品一区二区| 欧美日韩中文另类| 日本精品一级二级| 不卡av在线网| 国产精品888| 韩国欧美国产一区| 激情图片小说一区| 麻豆91精品视频| 日韩和欧美一区二区| 亚洲国产日韩一区二区| 亚洲最新视频在线观看| 亚洲男人的天堂网| 亚洲特级片在线| 中文字幕日本不卡| 国产精品成人一区二区艾草| 欧美激情一区二区在线| 国产日本欧洲亚洲| 欧美国产日产图区| 国产视频一区二区在线| 国产日韩欧美一区二区三区乱码| 久久久久综合网| 国产亚洲精品7777| 中日韩av电影| 国产亚洲女人久久久久毛片| 久久亚洲精精品中文字幕早川悠里 | 不卡高清视频专区| proumb性欧美在线观看| 国产成人日日夜夜| 成人激情免费网站| 色婷婷狠狠综合| 欧美日韩二区三区| 日韩亚洲欧美中文三级| 欧美精品一区二区三区在线| 久久丝袜美腿综合| 国产精品无人区| 一区二区三区鲁丝不卡| 午夜a成v人精品| 久久电影国产免费久久电影| 丰满岳乱妇一区二区三区| 99久久国产综合色|国产精品| 99国内精品久久| 欧美性感一区二区三区| 91精品国产欧美一区二区| 久久综合久久综合久久综合| 国产欧美日韩精品a在线观看| 亚洲精品久久久蜜桃| 日韩精品欧美精品| 成人一区在线观看| 在线亚洲一区二区| 精品美女在线观看| 成人欧美一区二区三区视频网页| 一区二区三区美女| 国产在线精品一区二区三区不卡| 99久久综合精品| 7777精品伊人久久久大香线蕉经典版下载| 日韩一区二区三区精品视频| 欧美国产日本韩| 日韩激情中文字幕| 97久久超碰国产精品| 精品成人一区二区三区四区| 国产精品福利在线播放| 热久久国产精品| 不卡一卡二卡三乱码免费网站| 欧美日韩国产高清一区二区三区 | 国产欧美一区二区精品性色| 亚洲高清免费一级二级三级| 国产999精品久久| 日韩三级视频在线看| 亚洲精品成a人|