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

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

?? stl_alloc.c

?? 粗慥集成算法集合 ,并有詳細的文檔資料和測試數據處
?? C
字號:
/*
 *
 * Copyright (c) 1996,1997
 * Silicon Graphics Computer Systems, Inc.
 *
 * Copyright (c) 1997
 * Moscow Center for SPARC Technology
 *
 * Copyright (c) 1999 
 * Boris Fomitchev
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *
 * Permission to use or copy this software for any purpose is hereby granted 
 * without fee, provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 *
 */
#ifndef __STL_ALLOC_C
#define __STL_ALLOC_C

// Specialised debug form of malloc which does not provide "false"
// memory leaks when run with debug CRT libraries.
#if defined(__STL_MSVC) && __STL_MSVC>=1020 && defined(_DEBUG)
#  include <crtdbg.h>
#  define   __STL_CHUNK_MALLOC(s)         _malloc_dbg(s, _CRT_BLOCK, __FILE__, __LINE__)
#else	// !_DEBUG
# ifdef __STL_NODE_ALLOC_USE_MALLOC
#  define   __STL_CHUNK_MALLOC(s)         ::malloc(s)
# else
#  define   __STL_CHUNK_MALLOC(s)         __stl_new(s)
# endif
#endif	// !_DEBUG

__STL_BEGIN_NAMESPACE


// malloc_alloc out-of-memory handling
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
template <int __inst>
__oom_handler_type __malloc_alloc<__inst>::__oom_handler=(__oom_handler_type)0 ;
#  else
__DECLARE_INSTANCE(__oom_handler_type, __malloc_alloc<0>::__oom_handler, =0);
# endif /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */

template <int __inst>
void * __malloc_alloc<__inst>::_S_oom_malloc(size_t __n)
{
  __oom_handler_type __my_malloc_handler;
  void * __result;

  for (;;) {
    __my_malloc_handler = __oom_handler;
    if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
    (*__my_malloc_handler)();
    __result = malloc(__n);
    if (__result) return(__result);
  }
#if defined(__STL_NEED_UNREACHABLE_RETURN)
  return 0;
#endif

}

template <int __inst>
void* __malloc_alloc<__inst>::_S_oom_realloc(void* __p, size_t __n)
{
  __oom_handler_type __my_malloc_handler;
  void* __result;

  for (;;) {
    __my_malloc_handler = __oom_handler;
    if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
    (*__my_malloc_handler)();
    __result = realloc(__p, __n);
    if (__result) return(__result);
  }
#if defined(__STL_NEED_UNREACHABLE_RETURN)
  return 0;
#endif
}


# ifdef __STL_DEBUG_ALLOC

template <class _Alloc>
void * __debug_alloc<_Alloc>::allocate(size_t __n) {
  size_t __real_n = __n + __extra_before_chunk() + __extra_after_chunk();
  __alloc_header *__result = (__alloc_header *)__allocator_type::allocate(__real_n);
  memset((char*)__result, __shred_byte, __real_n*sizeof(value_type));
  __result->__magic = __magic;
  __result->__type_size = sizeof(value_type);
  __result->_M_size = __n;
  return ((char*)__result) + (long)__extra_before;
}

template <class _Alloc>
void __debug_alloc<_Alloc>::deallocate(void *__p, size_t __n) {
  __alloc_header * __real_p = (__alloc_header*)((char *)__p -(long)__extra_before);
  // check integrity
  __stl_verbose_assert(__real_p->__magic != __deleted_magic, _StlMsg_DBA_DELETED_TWICE);
  __stl_verbose_assert(__real_p->__magic == __magic, _StlMsg_DBA_NEVER_ALLOCATED);
  __stl_verbose_assert(__real_p->__type_size == sizeof(value_type), 
		       _StlMsg_DBA_TYPE_MISMATCH);
  __stl_verbose_assert(__real_p->_M_size == __n, _StlMsg_DBA_SIZE_MISMATCH);
  // check pads on both sides
  unsigned char* __tmp;
  for (__tmp= (unsigned char*)(__real_p+1); __tmp < (unsigned char*)__p; __tmp++)
    __stl_verbose_assert(*__tmp==__shred_byte, _StlMsg_DBA_UNDERRUN);
  size_t __real_n= __n + __extra_before_chunk() + __extra_after_chunk();
  for (__tmp= ((unsigned char*)__p)+__n*sizeof(value_type); 
       __tmp < ((unsigned char*)__real_p)+__real_n ; __tmp++)
    __stl_verbose_assert(*__tmp==__shred_byte, _StlMsg_DBA_OVERRUN);
  // that may be unfortunate, just in case
  __real_p->__magic=__deleted_magic;
  memset((char*)__p, __shred_byte, __n*sizeof(value_type));
  __allocator_type::deallocate(__real_p, __real_n);
}

# if 0
template <class _Alloc>
void * 
__debug_alloc<_Alloc>::reallocate(void *__p, size_t __old_sz, size_t __new_sz) {
  __alloc_header * __real_p = (__alloc_header*)((char *)__p - (long)__extra_before);
  size_t __extra = __extra_before_chunk() + __extra_after_chunk();
  __stl_verbose_assert(__real_p->__magic != __deleted_magic, _StlMsg_DBA_DELETED_TWICE);
  __stl_verbose_assert(__real_p->__magic == __magic, _StlMsg_DBA_NEVER_ALLOCATED);
  __stl_verbose_assert(__real_p->__type_size == sizeof(value_type), 
		       _StlMsg_DBA_TYPE_MISMATCH);
  __stl_verbose_assert(__real_p->_M_size == __old_sz, _StlMsg_DBA_SIZE_MISMATCH);
  __real_p = (__alloc_header*)__allocator_type::reallocate(__real_p, __old_sz + __extra, 
							 __new_sz + __extra);
  __real_p->_M_size = __new_sz;
  return ((char*)__real_p) + (long)__extra_before;
}
# endif
#endif


/* We allocate memory in large chunks in order to avoid fragmenting     */
/* the malloc heap too much.                                            */
/* We assume that size is properly aligned.                             */
/* We hold the allocation lock.                                         */
template <bool __threads, int __inst>
char*
__node_alloc<__threads, __inst>::_S_chunk_alloc(size_t _p_size, 
						int& __nobjs)
{
  char* __result;
  size_t __total_bytes = _p_size * __nobjs;
  size_t __bytes_left = _S_end_free - _S_start_free;

  if (__bytes_left >= __total_bytes) {
    __result = _S_start_free;
    _S_start_free += __total_bytes;
    return(__result);
  } else if (__bytes_left >= _p_size) {
    __nobjs = (int)(__bytes_left/_p_size);
    __total_bytes = _p_size * __nobjs;
    __result = _S_start_free;
    _S_start_free += __total_bytes;
    return(__result);
  } else {
    size_t __bytes_to_get = 
      2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
    // Try to make use of the left-over piece.
    if (__bytes_left > 0) {
      _Obj* __STL_VOLATILE* __my_free_list =
	_S_free_list + _S_freelist_index(__bytes_left);

      ((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list;
      *__my_free_list = (_Obj*)_S_start_free;
    }
    _S_start_free = (char*)__STL_CHUNK_MALLOC(__bytes_to_get);
    if (0 == _S_start_free) {
      size_t __i;
      _Obj* __STL_VOLATILE* __my_free_list;
      _Obj* __p;
      // Try to make do with what we have.  That can't
      // hurt.  We do not try smaller requests, since that tends
      // to result in disaster on multi-process machines.
      for (__i = _p_size; __i <= (size_t)_MAX_BYTES; __i += (size_t)_ALIGN) {
	__my_free_list = _S_free_list + _S_freelist_index(__i);
	__p = *__my_free_list;
	if (0 != __p) {
	  *__my_free_list = __p -> _M_free_list_link;
	  _S_start_free = (char*)__p;
	  _S_end_free = _S_start_free + __i;
	  return(_S_chunk_alloc(_p_size, __nobjs));
	  // Any leftover piece will eventually make it to the
	  // right free list.
	}
      }
      _S_end_free = 0;	// In case of exception.
      _S_start_free = (char*)__STL_CHUNK_MALLOC(__bytes_to_get);
    /*
      (char*)malloc_alloc::allocate(__bytes_to_get);
      */

      // This should either throw an
      // exception or remedy the situation.  Thus we assume it
      // succeeded.
    }
    _S_heap_size += __bytes_to_get;
    _S_end_free = _S_start_free + __bytes_to_get;
    return(_S_chunk_alloc(_p_size, __nobjs));
  }
}


/* Returns an object of size __n, and optionally adds to size __n free list.*/
/* We assume that __n is properly aligned.                                */
/* We hold the allocation lock.                                         */
template <bool __threads, int __inst>
void*
__node_alloc<__threads, __inst>::_S_refill(size_t __n)
{
  int __nobjs = 20;
  __n = _S_round_up(__n);
  char* __chunk = _S_chunk_alloc(__n, __nobjs);
  _Obj* __STL_VOLATILE* __my_free_list;
  _Obj* __result;
  _Obj* __current_obj;
  _Obj* __next_obj;
  int __i;

  if (1 == __nobjs) return(__chunk);
  __my_free_list = _S_free_list + _S_freelist_index(__n);

  /* Build free list in chunk */
  __result = (_Obj*)__chunk;
  *__my_free_list = __next_obj = (_Obj*)(__chunk + __n);
  for (__i = 1; ; __i++) {
    __current_obj = __next_obj;
    __next_obj = (_Obj*)((char*)__next_obj + __n);
    if (__nobjs - 1 == __i) {
      __current_obj -> _M_free_list_link = 0;
      break;
    } else {
      __current_obj -> _M_free_list_link = __next_obj;
    }
  }
  return(__result);
}

# if 0
template <bool threads, int inst>
void*
__node_alloc<threads, inst>::reallocate(void* __p,
                                                    size_t __old_sz,
                                                    size_t __new_sz)
{
  void* __result;
  size_t __copy_sz;

  if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) {
    return(realloc(__p, __new_sz));
  }
  if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
  __result = allocate(__new_sz);
  __copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
  memcpy(__result, __p, __copy_sz);
  deallocate(__p, __old_sz);
  return(__result);
}
# endif

// those should have only one instance. Currently, if we not rebuild the std library,
// they are only being instantiated in the executable.

# if defined (__BUILDING_STLPORT_DLL) || ! defined (__STLPORT_DLL)

# if ( __STL_STATIC_TEMPLATE_DATA > 0 )

#ifdef __STL_THREADS
    template <bool __threads, int __inst>
    _STL_mutex_base
    __node_alloc<__threads, __inst>::_S_node_allocator_lock __STL_MUTEX_INITIALIZER;
#endif

template <bool __threads, int __inst>
char *__node_alloc<__threads, __inst>::_S_start_free = 0;

template <bool __threads, int __inst>
char *__node_alloc<__threads, __inst>::_S_end_free = 0;

template <bool __threads, int __inst>
size_t __node_alloc<__threads, __inst>::_S_heap_size = 0;

template <bool __threads, int __inst>
_Node_alloc_obj * __STL_VOLATILE
__node_alloc<__threads, __inst>::_S_free_list[_NFREELISTS]
 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// The 16 zeros are necessary to make version 4.1 of the SunPro
// compiler happy.  Otherwise it appears to allocate too little
// space for the array.

# else /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */
__DECLARE_INSTANCE(char *, __single_client_alloc::_S_start_free,=0);
__DECLARE_INSTANCE(char *, __single_client_alloc::_S_end_free,=0);
__DECLARE_INSTANCE(size_t, __single_client_alloc::_S_heap_size,=0);
__DECLARE_INSTANCE(_Node_alloc_obj * __STL_VOLATILE,
                   __single_client_alloc::_S_free_list[_NFREELISTS],
                   ={0});
__DECLARE_INSTANCE(char *, __multithreaded_alloc::_S_start_free,=0);
__DECLARE_INSTANCE(char *, __multithreaded_alloc::_S_end_free,=0);
__DECLARE_INSTANCE(size_t, __multithreaded_alloc::_S_heap_size,=0);
__DECLARE_INSTANCE(_Node_alloc_obj * __STL_VOLATILE,
                   __multithreaded_alloc::_S_free_list[_NFREELISTS],
                   ={0});
#   ifdef __STL_THREADS
__DECLARE_INSTANCE(_STL_mutex_base,
                   __single_client_alloc::_S_node_allocator_lock,
                   __STL_MUTEX_INITIALIZER);
__DECLARE_INSTANCE(_STL_mutex_base,
                   __multithreaded_alloc::_S_node_allocator_lock,
                   __STL_MUTEX_INITIALIZER);
#   endif
#  endif /* __STL_STATIC_TEMPLATE_DATA */
# endif /* __STLPORT_INSTANTIATE */

__STL_END_NAMESPACE

#endif /*  __STL_ALLOC_C */

// Local Variables:
// mode:C++
// End:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久午夜夜伦鲁鲁| 精品国产成人在线影院| 国产黄色91视频| 另类小说一区二区三区| 五月婷婷色综合| 热久久久久久久| 久久精品国产久精国产爱| 免费观看30秒视频久久| 经典三级一区二区| 国产成人啪午夜精品网站男同| 国产成人啪午夜精品网站男同| 国产一区二区三区黄视频 | 夜夜嗨av一区二区三区网页| 中文字幕一区日韩精品欧美| 国产精品久线观看视频| 亚洲精品videosex极品| 日韩av中文在线观看| 国模冰冰炮一区二区| 国产69精品一区二区亚洲孕妇| 大尺度一区二区| 色婷婷精品大视频在线蜜桃视频 | 亚洲国产精品一区二区www在线| 亚洲精品欧美二区三区中文字幕| 亚洲国产成人va在线观看天堂| 丝袜美腿亚洲色图| 激情六月婷婷久久| a在线欧美一区| 欧美三级乱人伦电影| 久久久久一区二区三区四区| 国产精品乱人伦中文| 午夜精品福利在线| 国产一区二区在线影院| 色一情一伦一子一伦一区| 91精品欧美久久久久久动漫 | 日韩av中文字幕一区二区| 国产成人a级片| 欧美日韩视频一区二区| 久久久精品免费观看| 亚洲一区二区在线视频| 国产永久精品大片wwwapp| 色婷婷av一区二区三区软件 | 9色porny自拍视频一区二区| 欧美日韩在线亚洲一区蜜芽| 久久老女人爱爱| 亚洲综合在线电影| 国产馆精品极品| 91精品国产色综合久久 | 一本大道av伊人久久综合| 欧美一级片在线| 《视频一区视频二区| 麻豆91免费看| 欧美视频一区二区| 日本一区二区电影| 麻豆国产精品一区二区三区| 91麻豆福利精品推荐| 久久综合九色综合97婷婷| 亚洲午夜一二三区视频| 成人成人成人在线视频| 欧美videos大乳护士334| 亚洲国产成人av| 色琪琪一区二区三区亚洲区| 国产精品免费免费| 国产一区二区美女诱惑| 欧美一区二区三级| 亚洲国产日日夜夜| 97aⅴ精品视频一二三区| 国产校园另类小说区| 精一区二区三区| 91麻豆精品国产91久久久久久| 有坂深雪av一区二区精品| 成人精品鲁一区一区二区| 久久影音资源网| 激情图片小说一区| 精品国产免费一区二区三区香蕉| 日韩国产一二三区| 91精品国产综合久久国产大片| 一区二区三区免费看视频| 91女人视频在线观看| 中文字幕一区在线观看视频| 99视频一区二区三区| 中文字幕一区二区三区乱码在线| 国产成人av影院| 国产丝袜欧美中文另类| 国产91精品一区二区麻豆网站 | 亚洲欧美日韩国产中文在线| 一本一道波多野结衣一区二区| 日韩理论片一区二区| 色狠狠一区二区| 香蕉久久一区二区不卡无毒影院 | 欧美一区永久视频免费观看| 午夜精品一区二区三区免费视频| 7777精品伊人久久久大香线蕉 | 91日韩在线专区| 亚洲成人第一页| 日韩三级视频在线观看| 国产一区二区三区四区五区美女| 久久久激情视频| 色综合天天综合网国产成人综合天 | 亚洲精品一二三区| 337p亚洲精品色噜噜狠狠| 麻豆精品视频在线| 国产精品色哟哟| 精品婷婷伊人一区三区三| 日本成人在线看| 国产精品久久久一区麻豆最新章节| 91浏览器打开| 麻豆久久一区二区| 国产精品久久久久久久浪潮网站 | 国产一区二区三区免费看| 国产精品国产三级国产aⅴ中文 | 日韩美女在线视频 | 性欧美疯狂xxxxbbbb| 欧美成人午夜电影| 99久久99久久久精品齐齐| 日韩专区在线视频| 欧美高清在线视频| 欧美高清视频在线高清观看mv色露露十八| 麻豆免费精品视频| 夜色激情一区二区| 国产日韩精品一区| 欧美日本一道本| 成人动漫中文字幕| 久久99最新地址| 亚洲一本大道在线| 亚洲欧洲精品天堂一级| 欧美成人一区二区| 欧美中文字幕亚洲一区二区va在线| 国产精品一区免费在线观看| 亚洲一区自拍偷拍| 国产精品美女一区二区在线观看| 欧美一区二视频| 色噜噜狠狠一区二区三区果冻| 极品少妇xxxx偷拍精品少妇| 亚洲午夜久久久久久久久久久| 国产女同性恋一区二区| 日韩欧美电影在线| 欧美日本在线视频| 91成人国产精品| 99精品国产一区二区三区不卡| 久久精品国产第一区二区三区| 亚洲午夜视频在线观看| 国产精品高清亚洲| 国产日韩精品一区二区三区在线| 日韩欧美国产三级电影视频| 在线成人免费观看| 欧美日本一区二区三区| 欧美私模裸体表演在线观看| 色天使久久综合网天天| 91麻豆swag| 色噜噜狠狠一区二区三区果冻| 99vv1com这只有精品| kk眼镜猥琐国模调教系列一区二区| 国产黄人亚洲片| 成人午夜激情影院| 风流少妇一区二区| 岛国一区二区在线观看| 国产jizzjizz一区二区| 成人午夜视频在线观看| av电影在线观看完整版一区二区| 韩国v欧美v亚洲v日本v| 国产一本一道久久香蕉| 国产精品99久久久久久久女警| 狠狠v欧美v日韩v亚洲ⅴ| 国产经典欧美精品| 成人免费黄色大片| 成人理论电影网| 91麻豆国产香蕉久久精品| 91视频观看免费| 欧日韩精品视频| 7777精品伊人久久久大香线蕉完整版| 9191成人精品久久| 精品国产伦一区二区三区观看方式| 2021国产精品久久精品| 国产精品嫩草99a| 亚洲国产一区二区a毛片| 日本va欧美va精品发布| 国产精品亚洲一区二区三区在线| 高清国产午夜精品久久久久久| av激情亚洲男人天堂| 欧美精品在欧美一区二区少妇| 日韩美女视频一区二区在线观看| 久久精品在这里| 亚洲另类色综合网站| 美女网站在线免费欧美精品| 成人免费福利片| 欧美精品视频www在线观看| 精品国产乱码久久久久久蜜臀| 欧美激情一区二区| 午夜精品久久久久久久| 丁香六月综合激情| 欧美精品黑人性xxxx| 亚洲国产精品成人综合| 天天操天天干天天综合网| 国产精品白丝jk白祙喷水网站 | 蜜臀av一区二区在线免费观看| a级精品国产片在线观看| 欧美一区午夜精品| 亚洲人xxxx| 国产一本一道久久香蕉| 欧美疯狂做受xxxx富婆|