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

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

?? processheap.cpp

?? newos is new operation system
?? CPP
字號:
///-*-C++-*-////////////////////////////////////////////////////////////////////// Hoard: A Fast, Scalable, and Memory-Efficient Allocator//        for Shared-Memory Multiprocessors// Contact author: Emery Berger, http://www.cs.utexas.edu/users/emery//// Copyright (c) 1998-2000, The University of Texas at Austin.//// This library is free software; you can redistribute it and/or modify// it under the terms of the GNU Library General Public License as// published by the Free Software Foundation, http://www.fsf.org.//// This library is distributed in the hope that it will be useful, but// WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Library General Public License for more details.////////////////////////////////////////////////////////////////////////////////#include <string.h>#include <stdio.h>#include "config.h"#if USE_PRIVATE_HEAPS#include "privateheap.h"#define HEAPTYPE privateHeap#else#define HEAPTYPE threadHeap#include "threadheap.h"#endif#include "processheap.h"processHeap::processHeap (void)  : _buffer (NULL),    _bufferCount (0)#if HEAP_FRAG_STATS  , _currentAllocated (0),  _currentRequested (0),  _maxAllocated (0),  _inUseAtMaxAllocated (0),  _maxRequested (0)#endif{  int i;  // The process heap is heap 0.  setIndex (0);  for (i = 0; i < MAX_HEAPS; i++) {    // Set every thread's process heap to this one.    theap[i].setpHeap (this);    // Set every thread heap's index.    theap[i].setIndex (i + 1);  }#if HEAP_LOG  for (i = 0; i < MAX_HEAPS + 1; i++) {    char fname[255];    sprintf (fname, "log%d", i);    unlink (fname);    _log[i].open (fname);  }#endif#if HEAP_FRAG_STATS  hoardLockInit (_statsLock);#endif  hoardLockInit (_bufferLock);}// Print out statistics information.void processHeap::stats (void) {#if HEAP_STATS  int umax = 0;  int amax = 0;  for (int j = 0; j < MAX_HEAPS; j++) {    for (int i = 0; i < SIZE_CLASSES; i++) {      amax += theap[j].maxAllocated(i) * sizeFromClass (i);      umax += theap[j].maxInUse(i) * sizeFromClass (i);    }  }  printf ("Amax <= %d, Umax <= %d\n", amax, umax);#if HEAP_FRAG_STATS  amax = getMaxAllocated();  umax = getMaxRequested();  printf ("Maximum allocated = %d\nMaximum in use = %d\nIn use at max allocated = %d\n", amax, umax, getInUseAtMaxAllocated());  printf ("Still in use = %d\n", _currentRequested);  printf ("Fragmentation (3) = %f\n", (float) amax / (float) getInUseAtMaxAllocated());  printf ("Fragmentation (4) = %f\n", (float) amax / (float) umax);#endif#endif // HEAP_STATS#if HEAP_LOG  printf ("closing logs.\n");  fflush (stdout);  for (int i = 0; i < MAX_HEAPS + 1; i++) {    _log[i].close();  }#endif}#if HEAP_FRAG_STATSvoid processHeap::setAllocated (int requestedSize,				int actualSize){  hoardLock (_statsLock);  _currentRequested += requestedSize;  _currentAllocated += actualSize;  if (_currentRequested > _maxRequested) {    _maxRequested = _currentRequested;  }  if (_currentAllocated > _maxAllocated) {    _maxAllocated = _currentAllocated;    _inUseAtMaxAllocated = _currentRequested;  }  hoardUnlock (_statsLock);}void processHeap::setDeallocated (int requestedSize,				  int actualSize){  hoardLock (_statsLock);  _currentRequested -= requestedSize;  _currentAllocated -= actualSize;  hoardUnlock (_statsLock);}#endif// free (ptr, pheap)://   inputs: a pointer to an object allocated by malloc().//   side effects: returns the block to the object's superblock;//                 updates the thread heap's statistics;//                 may release the superblock to the process heap.void processHeap::free (void * ptr){  // Return if ptr is 0.  // This is the behavior prescribed by the standard.  if (ptr == 0) {    return;  }  // Find the block and superblock corresponding to this ptr.  block * b = (block *) ptr - 1;  assert (b->isValid());  // Check to see if this block came from a memalign() call.  if (((unsigned long) b->getNext() & 1) == 1) {    // It did. Set the block to the actual block header.    b = (block *) ((unsigned long) b->getNext() & ~1);    assert (b->isValid());  }  b->markFree();  superblock * sb = b->getSuperblock();  assert (sb);  assert (sb->isValid());  const int sizeclass = sb->getBlockSizeClass();  //  // Return the block to the superblock,  // find the heap that owns this superblock  // and update its statistics.  //  hoardHeap * owner;  // By acquiring the up lock on the superblock,  // we prevent it from moving to the global heap.  // This eventually pins it down in one heap,  // so this loop is guaranteed to terminate.  // (It should generally take no more than two iterations.)  sb->upLock();  while (1) {    owner = sb->getOwner();    owner->lock();    if (owner == sb->getOwner()) {      break;    } else {      owner->unlock();    }    // Suspend to allow ownership to quiesce.    hoardYield();  }#if HEAP_LOG  MemoryRequest m;  m.free (ptr);  getLog (owner->getIndex()).append(m);#endif#if HEAP_FRAG_STATS  setDeallocated (b->getRequestedSize(), 0);#endif  int sbUnmapped = owner->freeBlock (b, sb, sizeclass, this);  owner->unlock();  if (!sbUnmapped) {    sb->upUnlock();  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品538一区二区在线| 色激情天天射综合网| 美女爽到高潮91| 日韩精品乱码免费| 亚州成人在线电影| 亚洲一二三区视频在线观看| 亚洲欧美一区二区三区极速播放| 国产精品久久久一本精品| 中文字幕亚洲在| 亚洲天堂久久久久久久| 亚洲日本在线看| 亚洲蜜臀av乱码久久精品| 亚洲最新视频在线播放| 亚洲第一搞黄网站| 99riav久久精品riav| 99久久精品免费精品国产| 成人a级免费电影| 在线日韩av片| 3atv一区二区三区| 精品免费国产一区二区三区四区| 久久久99久久| 日韩一区在线播放| 亚洲第一福利一区| 美国三级日本三级久久99| 国产中文字幕精品| av动漫一区二区| 在线观看亚洲精品视频| 欧美男男青年gay1069videost| 91精品免费在线观看| 26uuu另类欧美| 中文字幕一区二区三区乱码在线| 夜夜嗨av一区二区三区中文字幕| 亚洲成人激情自拍| 激情久久五月天| 色综合久久88色综合天天免费| 欧美色区777第一页| 欧美一区二区三区在线电影| 欧美经典一区二区| 一区二区视频在线看| 日本欧美久久久久免费播放网| 国产成人在线观看| 欧美在线高清视频| www亚洲一区| 一区二区三区高清在线| 韩国女主播成人在线| 色综合激情久久| 欧美成人国产一区二区| 亚洲欧美福利一区二区| 蜜桃视频在线观看一区| 9人人澡人人爽人人精品| 7777精品伊人久久久大香线蕉的 | 欧美性受xxxx| 久久综合网色—综合色88| 亚洲乱码中文字幕| 久久99热国产| 26uuu色噜噜精品一区二区| 国产精品每日更新| 午夜电影久久久| 99久久精品国产网站| 91精品国产麻豆国产自产在线| 国产精品理论片| 美腿丝袜在线亚洲一区| 日本精品免费观看高清观看| 日韩久久精品一区| 亚洲一区二区三区四区中文字幕| 国产白丝精品91爽爽久久| 欧美一区二区三区四区久久| 亚洲欧美乱综合| 国产精品白丝jk白祙喷水网站 | 伊人一区二区三区| 国产精品自拍一区| 91精品国产91久久久久久最新毛片| 中文字幕一区二区三区在线观看 | 欧美久久久久久久久中文字幕| 国产欧美视频在线观看| 日韩成人精品视频| 欧洲视频一区二区| 中文字幕一区二区在线观看| 国内精品免费在线观看| 国产91精品在线观看| 69堂成人精品免费视频| 亚洲另类在线制服丝袜| 波多野结衣中文字幕一区 | 国产精品天天看| 久草中文综合在线| 欧美日本一区二区三区| 一级女性全黄久久生活片免费| 国产91在线观看丝袜| 精品少妇一区二区三区| 日韩专区中文字幕一区二区| 欧美亚洲国产一区在线观看网站| 综合中文字幕亚洲| av一区二区三区在线| 国产亚洲精品资源在线26u| 狠狠色丁香久久婷婷综| 日韩美女天天操| 毛片一区二区三区| 日韩精品自拍偷拍| 久久电影网站中文字幕| 日韩一卡二卡三卡国产欧美| 免费精品视频在线| 欧美一区二区三区在线| 美国精品在线观看| 欧美刺激脚交jootjob| 蜜桃av一区二区在线观看 | 麻豆国产精品一区二区三区 | 日本一区免费视频| 高清在线观看日韩| 中文字幕精品一区二区精品绿巨人| 国产成人日日夜夜| 亚洲国产精品传媒在线观看| 国产.精品.日韩.另类.中文.在线.播放| 久久综合九色综合欧美亚洲| 国产乱色国产精品免费视频| 国产亚洲欧美中文| 91尤物视频在线观看| 亚洲精品日产精品乱码不卡| 国产精品12区| 久久久久99精品一区| 成人福利视频网站| 亚洲色图.com| 欧美视频第二页| 日本中文一区二区三区| 精品美女被调教视频大全网站| 国产精品资源在线看| 国产精品欧美久久久久一区二区| 东方aⅴ免费观看久久av| 亚洲欧洲精品一区二区精品久久久| 色综合天天综合网天天看片| 午夜不卡av免费| 亚洲精品在线观| 成人黄色在线网站| 一卡二卡欧美日韩| 日韩欧美一区在线| 丁香婷婷综合激情五月色| 一区二区三区小说| 91精品在线免费| 国产成人免费网站| 一区二区三区四区在线| 日韩欧美一区二区久久婷婷| 成人一区二区三区| 亚洲成人免费av| 国产亚洲欧美色| 欧美三级电影精品| 国产乱码精品一区二区三区忘忧草| 中文字幕一区二区三区不卡在线| 欧美老年两性高潮| 成人一区二区三区在线观看| 亚洲成人综合网站| 久久久综合精品| 欧美日本一道本在线视频| 国产成人综合网| 日韩精品高清不卡| 中文字幕一区二区日韩精品绯色| 91精品久久久久久久久99蜜臂| 不卡视频免费播放| 青娱乐精品视频在线| 亚洲欧洲日韩女同| 亚洲精品一区二区三区福利| 色一情一伦一子一伦一区| 另类综合日韩欧美亚洲| 亚洲老司机在线| 久久久亚洲午夜电影| 欧美日韩高清在线播放| 成人精品一区二区三区四区| 久久精品国产亚洲a| 亚洲在线观看免费视频| 国产亚洲一区二区三区在线观看| 91麻豆精品国产91| 91麻豆自制传媒国产之光| 国产一区二区三区四区在线观看| 亚洲一区在线观看免费| 国产精品美女久久久久久| 日韩欧美国产成人一区二区| 色天使色偷偷av一区二区| 国产成人8x视频一区二区| 蜜桃久久久久久| 日韩中文字幕区一区有砖一区| 国产精品初高中害羞小美女文| 欧美成人国产一区二区| 欧美精品xxxxbbbb| 91麻豆.com| 成人av在线资源| 懂色av一区二区三区蜜臀| 国内精品视频666| 免费黄网站欧美| 日韩高清在线观看| 一区二区三区四区高清精品免费观看| 中文av一区二区| 国产欧美一区二区精品仙草咪| 精品成人a区在线观看| 日韩欧美一级精品久久| 欧美日韩卡一卡二| 91蝌蚪porny九色| 成人97人人超碰人人99| 国产馆精品极品| 国产成人在线影院| 国产成人在线视频网站| 国产精品一二三四| 国产一区91精品张津瑜|