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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? strngmem.c

?? BCAST Implementation for NS2
?? C
字號:
/* * Copyright (c) 2000, 2001 by Martin C. Shepherd. *  * All rights reserved. *  * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, and/or sell copies of the Software, and to permit persons * to whom the Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *  * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * of the copyright holder. */#include <stdlib.h>#include <stdio.h>#include "strngmem.h"#include "freelist.h"struct StringMem {  unsigned long nmalloc;  /* The number of strings allocated with malloc */  FreeList *fl;           /* The free-list */};/*....................................................................... * Create a string free-list container and the first block of its free-list. * * Input: *  caller     const char *  The name of the calling function, or NULL *                           to not report errors to stderr. *  blocking_factor   int    The blocking_factor argument specifies how *                           many strings of length SM_STRLEN *                           bytes (see stringmem.h) are allocated in each *                           free-list block. *                           For example if blocking_factor=64 and *                           SM_STRLEN=16, then each new *                           free-list block will take 1K of memory. * Output: *  return      StringMem *  The new free-list container, or NULL on *                           error. */StringMem *_new_StringMem(const char *caller, unsigned blocking_factor){  StringMem *sm;    /* The container to be returned. *//* * Check arguments. */  if(blocking_factor < 1) {    if(caller) {      fprintf(stderr, "_new_StringMem (%s): Bad blocking factor (%d).\n",	      caller, blocking_factor);    };    return NULL;  };/* * Allocate the container. */  sm = (StringMem *) malloc(sizeof(StringMem));  if(!sm) {    if(caller)      fprintf(stderr, "_new_StringMem (%s): Insufficient memory.\n", caller);    return NULL;  };/* * Before attempting any operation that might fail, initialize * the container at least up to the point at which it can safely * be passed to _del_StringMem(). */  sm->nmalloc = 0;  sm->fl = NULL;/* * Allocate the free-list. */  sm->fl = _new_FreeList(caller, SM_STRLEN, blocking_factor);  if(!sm->fl)    return _del_StringMem(caller, sm, 1);/* * Return the free-list container. */  return sm;}/*....................................................................... * Delete a string free-list. * * Input: *  caller  const char *  The name of the calling function, or NULL to *                        not report errors to stderr. *  sm       StringMem *  The string free-list to be deleted, or NULL. *  force          int    If force==0 then _del_StringMem() will complain *                         and refuse to delete the free-list if any *                         of nodes have not been returned to the free-list. *                        If force!=0 then _del_StringMem() will not check *                         whether any nodes are still in use and will *                         always delete the list. * Output: *  return   StringMem *  Always NULL (even if the list couldn't be *                        deleted). */StringMem *_del_StringMem(const char *caller, StringMem *sm, int force){  if(sm) {/* * Check whether any strings have not been returned to the free-list. */    if(!force && (sm->nmalloc > 0 || _busy_FreeListNodes(sm->fl) > 0)) {      if(caller)	fprintf(stderr, "_del_StringMem (%s): Free-list in use.\n", caller);      return NULL;    };/* * Delete the free-list. */    sm->fl = _del_FreeList(caller, sm->fl, force);/* * Delete the container. */    free(sm);  };  return NULL;}/*....................................................................... * Allocate an array of 'length' chars. * * Input: *  sm      StringMem *  The string free-list to allocate from. *  length     size_t    The length of the new string (including '\0'). * Output: *  return       char *  The new string or NULL on error. */char *_new_StringMemString(StringMem *sm, size_t length){  char *string;   /* The string to be returned */  int was_malloc; /* True if malloc was used to allocate the string *//* * Check arguments. */  if(!sm)    return NULL;  if(length < 1)    length = 1;/* * Allocate the new node from the free list if possible. */  if(length < SM_STRLEN) {    string = (char *)_new_FreeListNode(sm->fl);    if(!string)      return NULL;    was_malloc = 0;  } else {    string = (char *) malloc(length+1); /* Leave room for the flag byte */    if(!string)      return NULL;/* * Count malloc allocations. */    was_malloc = 1;    sm->nmalloc++;  };/* * Use the first byte of the string to record whether the string was * allocated with malloc or from the free-list. Then return the rest * of the string for use by the user. */  string[0] = (char) was_malloc;  return string + 1;}/*....................................................................... * Free a string that was previously returned by _new_StringMemString(). * * Input: *  sm      StringMem *  The free-list from which the string was originally *                       allocated. *  s            char *  The string to be returned to the free-list, or NULL. * Output: *  return       char *  Always NULL. */char *_del_StringMemString(StringMem *sm, char *s){  int was_malloc;  /* True if the string originally came from malloc() *//* * Is there anything to be deleted? */  if(s && sm) {/* * Retrieve the true string pointer. This is one less than the one * returned by _new_StringMemString() because the first byte of the * allocated memory is reserved by _new_StringMemString as a flag byte * to say whether the memory was allocated from the free-list or directly * from malloc(). */    s--;/* * Get the origination flag. */    was_malloc = s[0];    if(was_malloc) {      free(s);      s = NULL;      sm->nmalloc--;    } else {      s = (char *) _del_FreeListNode(sm->fl, s);    };  };  return NULL;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
洋洋av久久久久久久一区| 精品日韩一区二区三区免费视频| 中文字幕免费不卡在线| 国产精品综合一区二区三区| 91精品欧美综合在线观看最新| 同产精品九九九| 欧美一区二区成人6969| 麻豆精品视频在线观看视频| 精品国产在天天线2019| 国产一区二区三区av电影| 国产日韩综合av| 99国产精品国产精品毛片| 亚洲宅男天堂在线观看无病毒| 欧美猛男男办公室激情| 久久国产尿小便嘘嘘尿| 精品美女在线播放| 国产suv精品一区二区6| 国产精品乱人伦一区二区| 91福利视频网站| 久久成人综合网| 久久精品这里都是精品| 91免费版pro下载短视频| 香蕉成人伊视频在线观看| 91精品国产综合久久精品图片| 国产在线精品免费| 亚洲三级免费电影| 日韩免费一区二区三区在线播放| 欧美综合欧美视频| 老司机精品视频一区二区三区| 国产精品视频线看| 欧美精品视频www在线观看| 捆绑调教一区二区三区| 国产精品福利一区二区三区| 欧美日本一道本在线视频| 国内精品写真在线观看| 洋洋av久久久久久久一区| 久久久.com| 精品视频资源站| 丁香啪啪综合成人亚洲小说| 性感美女极品91精品| 国产精品丝袜黑色高跟| 91精品国产欧美日韩| 91免费在线播放| 国产盗摄一区二区三区| 日韩精品欧美精品| 国产精品免费av| 欧美大片一区二区| 色综合久久久久久久久久久| 国产精品一区二区久久不卡 | 国产精品一区专区| 亚洲电影一区二区| 综合久久久久久| 国产欧美一区二区精品秋霞影院| 欧美日韩大陆一区二区| 色婷婷av一区二区三区gif | 日韩和欧美的一区| 中文字幕亚洲精品在线观看| 久久久久久久久久看片| 日韩欧美一区二区三区在线| 欧美日韩国产高清一区二区| jlzzjlzz亚洲女人18| 国产精品一区二区三区99| 麻豆成人久久精品二区三区小说| 亚洲综合免费观看高清完整版| 欧美激情在线免费观看| 国产日韩欧美一区二区三区综合| 精品久久久久久久久久久院品网| 欧美日韩国产精选| 88在线观看91蜜桃国自产| 欧美日韩黄色一区二区| 在线看国产一区二区| 色综合天天综合在线视频| 成人精品国产免费网站| 成人精品国产福利| www.av亚洲| 91麻豆国产精品久久| av亚洲精华国产精华精华| 成人黄页在线观看| 高清成人免费视频| 成人一区二区在线观看| 99久久久精品| 91免费版pro下载短视频| 日本精品视频一区二区| 欧美图片一区二区三区| 欧美裸体bbwbbwbbw| 欧美一区二区视频免费观看| 日韩免费高清av| 久久九九全国免费| 亚洲少妇30p| 无码av免费一区二区三区试看| 国产69精品一区二区亚洲孕妇| 国产91精品在线观看| av中文字幕不卡| 欧美自拍偷拍午夜视频| 3d动漫精品啪啪一区二区竹菊| 日韩精品中文字幕一区| 久久久久国产精品人| 日韩美女视频一区二区| 亚洲一区二区三区国产| 日韩av在线播放中文字幕| 国产一区二区三区观看| 成人免费视频app| 欧美视频你懂的| 精品久久久久久久一区二区蜜臀| 亚洲国产激情av| 一区二区三区国产精华| 麻豆成人综合网| 成人性视频免费网站| 色屁屁一区二区| 日韩天堂在线观看| 中文无字幕一区二区三区| 一区二区高清在线| 国产真实乱对白精彩久久| a级精品国产片在线观看| 欧美日韩高清一区二区三区| 久久综合九色综合97_久久久| 中文字幕一区二区5566日韩| 日本一区中文字幕| 懂色av一区二区三区免费看| 欧美精品一级二级三级| 国产亚洲精品福利| 午夜在线成人av| 国产91丝袜在线播放九色| 在线不卡a资源高清| 国产精品毛片a∨一区二区三区| 偷拍一区二区三区| 99精品视频在线观看免费| 日韩一二三四区| 亚洲最色的网站| a在线欧美一区| 久久综合999| 五月激情综合色| 色8久久精品久久久久久蜜| 精品国产凹凸成av人导航| 亚洲图片欧美色图| 99这里只有精品| 久久精品欧美一区二区三区麻豆 | 日韩不卡一二三区| 色香蕉久久蜜桃| 国产精品久久看| 美女网站色91| 欧美日韩精品一区二区三区蜜桃 | 亚洲激情图片小说视频| 国产精品亚洲一区二区三区在线| 欧美日韩一区三区四区| 亚洲乱码中文字幕| 丁香婷婷深情五月亚洲| 欧美大片一区二区| 日本成人在线看| 91麻豆精品国产无毒不卡在线观看 | 中文字幕va一区二区三区| 免费成人性网站| 欧美三级欧美一级| 夜夜嗨av一区二区三区网页| 97久久超碰国产精品| 欧美国产国产综合| 国产精品1024| 久久精品一区二区三区不卡牛牛| 日本欧美在线观看| 欧美日本免费一区二区三区| 亚洲尤物在线视频观看| 一本一道综合狠狠老| 亚洲欧美日韩小说| 色综合色综合色综合| 亚洲欧美日韩国产中文在线| 99视频精品在线| 亚洲欧洲av一区二区三区久久| 成人激情电影免费在线观看| 国产精品毛片大码女人| 99免费精品视频| 亚洲欧美一区二区三区孕妇| 色综合视频在线观看| 亚洲在线视频网站| 欧美伦理电影网| 美女一区二区三区在线观看| 日韩视频免费观看高清在线视频| 免费观看在线综合色| 精品99一区二区| 国产精品77777| 中文无字幕一区二区三区| 91丨porny丨国产| 一区二区三区成人在线视频| 欧美日韩精品欧美日韩精品一| 日韩国产欧美视频| 精品国产免费一区二区三区香蕉| 韩国一区二区三区| 一区在线观看视频| 欧日韩精品视频| 麻豆国产欧美日韩综合精品二区 | 日本三级韩国三级欧美三级| 精品国产a毛片| 99久久国产综合精品色伊| 亚洲自拍偷拍欧美| 日韩一区二区三区电影| 国产成人亚洲综合a∨婷婷| 亚洲精品成人精品456| 欧美日韩精品三区| 国产精品一区二区果冻传媒| 亚洲柠檬福利资源导航| 日韩欧美中文字幕精品|