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

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

?? mvarimpl.inl

?? ecos下的gui開發源代碼
?? INL
?? 第 1 頁 / 共 2 頁
字號:
#ifndef CYGONCE_MEMALLOC_MVARIMPL_INL
#define CYGONCE_MEMALLOC_MVARIMPL_INL

//==========================================================================
//
//      mvarimpl.inl
//
//      Memory pool with variable block class declarations
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos 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 General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    hmt
// Contributors: jlarmour
// Date:         2000-06-12
// Purpose:      Define Mvarimpl class interface
// Description:  Inline class for constructing a variable block allocator
// Usage:        #include <cyg/memalloc/mvarimpl.hxx>
//
//
//####DESCRIPTIONEND####
//
//==========================================================================

#include <pkgconf/memalloc.h>
#include <cyg/memalloc/mvarimpl.hxx>

#include <cyg/infra/cyg_ass.h>           // assertion support
#include <cyg/infra/cyg_trac.h>          // tracing support

// Simple allocator

// The free list is stored on a doubly linked list, each member of
// which is stored in the body of the free memory.  The head of the
// list has the same structure but its size field is zero.  This
// resides in the memory pool structure.  Always having at least one
// item on the list simplifies the alloc and free code.

// 
inline cyg_int32
Cyg_Mempool_Variable_Implementation::roundup( cyg_int32 size )
{

    size += sizeof(struct memdq);
    size = (size + alignment - 1) & -alignment;
    return size;
}

inline struct Cyg_Mempool_Variable_Implementation::memdq *
Cyg_Mempool_Variable_Implementation::addr2memdq( cyg_uint8 *addr )
{
    struct memdq *dq;
    dq = (struct memdq *)(roundup((cyg_int32)addr) - sizeof(struct memdq));
    return dq;
}

inline struct Cyg_Mempool_Variable_Implementation::memdq *
Cyg_Mempool_Variable_Implementation::alloc2memdq( cyg_uint8 *addr )
{
    return (struct memdq *)(addr - sizeof(struct memdq));
}

inline cyg_uint8 *
Cyg_Mempool_Variable_Implementation::memdq2alloc( struct memdq *dq )
{
    return ((cyg_uint8 *)dq + sizeof(struct memdq));
}

// -------------------------------------------------------------------------

inline void
Cyg_Mempool_Variable_Implementation::insert_free_block( struct memdq *dq )
{
    struct memdq *hdq=&head;

    freemem += dq->size;
#ifdef CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE
// For simple coalescing have the free list be sorted by memory base address
    struct memdq *idq;
    
    for (idq = hdq->next; idq != hdq; idq = idq->next) {
        if (idq > dq)
            break;
    }
    // we want to insert immediately before idq
    dq->next = idq;
    dq->prev = idq->prev;
    idq->prev = dq;
    dq->prev->next = dq;

    // Now do coalescing, but leave the head of the list alone.
    if (dq->next != hdq && (char *)dq + dq->size == (char *)dq->next) {
        dq->size += dq->next->size;
        dq->next = dq->next->next;
        dq->next->prev = dq;
    }
    if (dq->prev != hdq && (char *)dq->prev + dq->prev->size == (char *)dq) {
        dq->prev->size += dq->size;
        dq->prev->next = dq->next;
        dq->next->prev = dq->prev;
        dq = dq->prev;
    }
#else
    dq->prev = hdq;
    dq->next = hdq->next;
    hdq->next = dq;
    dq->next->prev=dq;
#endif
}

// -------------------------------------------------------------------------

inline
Cyg_Mempool_Variable_Implementation::Cyg_Mempool_Variable_Implementation(
        cyg_uint8 *base,
        cyg_int32 size,
        CYG_ADDRWORD align )
{
    CYG_REPORT_FUNCTION();

    CYG_ASSERT( align > 0, "Bad alignment" );
    CYG_ASSERT(0!=align ,"align is zero");
    CYG_ASSERT(0==(align & align-1),"align not a power of 2");

    if ((unsigned)size < sizeof(struct memdq)) {
        bottom = NULL;
        return;
    }

    obase=base;
    osize=size;

    alignment = align;
    while (alignment < (cyg_int32)sizeof(struct memdq))
        alignment += alignment;
    CYG_ASSERT(0==(alignment & alignment-1),"alignment not a power of 2");

    // the memdq for each allocation is always positioned immediately before
    // an aligned address, so that the allocation (i.e. what eventually gets
    // returned from alloc()) is at the correctly aligned address
    // Therefore bottom is set to the lowest available address given the size of
    // struct memdq and the alignment. 
    bottom = (cyg_uint8 *)addr2memdq(base);

    // because we split free blocks by allocating memory from the end, not
    // the beginning, then to preserve alignment, the *top* must also be
    // aligned such that (top-bottom) is a multiple of the alignment
    top = (cyg_uint8 *)((cyg_int32)(base+size+sizeof(struct memdq)) & -alignment) -
        sizeof(struct memdq);
    
    CYG_ASSERT( top > bottom , "heap too small" );
    CYG_ASSERT( top <= (base+size), "top too large" );
    CYG_ASSERT( ((cyg_int32)(top+sizeof(struct memdq)) & alignment-1)==0,
                "top badly aligned" );

    struct memdq *hdq = &head, *dq = (struct memdq *)bottom;
    
    CYG_ASSERT( ((cyg_int32)memdq2alloc(dq) & alignment-1)==0,
                 "bottom badly aligned" );

    hdq->prev = hdq->next = dq;
    hdq->size = 0;
    dq->prev = dq->next = hdq;

    freemem = dq->size = top - bottom;
}

// -------------------------------------------------------------------------

inline
Cyg_Mempool_Variable_Implementation::~Cyg_Mempool_Variable_Implementation()
{
}

// -------------------------------------------------------------------------
// allocation is simple
// First we look down the free list for a large enough block
// If we find a block the right size, we unlink the block from
//    the free list and return a pointer to it.
// If we find a larger block, we chop a piece off the end
//    and return that
// Otherwise we will eventually get back to the head of the list
//    and return NULL
inline cyg_uint8 *
Cyg_Mempool_Variable_Implementation::try_alloc( cyg_int32 size )
{
    struct memdq *dq = &head;
    cyg_uint8 *alloced;

    CYG_REPORT_FUNCTION();

    //  Allow uninitialised (zero sized) heaps because they could exist as a
    //  quirk of the MLT setup where a dynamically sized heap is at the top of
    //  memory.
    if (NULL == bottom)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精彩视频一区二区三区| 99久久精品免费精品国产| 中文字幕欧美日本乱码一线二线| 色噜噜狠狠成人网p站| 捆绑调教美女网站视频一区| 亚洲视频 欧洲视频| 久久精品免费在线观看| 欧洲精品中文字幕| 成人免费毛片高清视频| 麻豆视频一区二区| 亚洲第一激情av| 亚洲国产精品精华液ab| 精品理论电影在线| 在线成人免费视频| 日本精品一区二区三区四区的功能| 经典三级一区二区| 亚洲午夜久久久久中文字幕久| 中文在线免费一区三区高中清不卡| 欧美一区二区在线不卡| 欧美色爱综合网| 97久久精品人人澡人人爽| 国产成人在线免费观看| 国产一区二区在线看| 人人狠狠综合久久亚洲| 亚洲成人久久影院| 亚洲影院久久精品| 一区二区三区在线免费播放| 国产精品久久久久久久岛一牛影视| 2023国产一二三区日本精品2022| 日韩免费观看高清完整版| 欧美日韩国产综合一区二区| 色偷偷88欧美精品久久久| 波多野结衣91| 99天天综合性| 成人短视频下载 | 国内精品久久久久影院薰衣草 | 91电影在线观看| 99re亚洲国产精品| av在线综合网| 一本久久a久久精品亚洲| 色综合久久88色综合天天6| 91视频在线观看| 在线观看亚洲精品视频| 日本高清不卡aⅴ免费网站| 色欧美88888久久久久久影院| 99久久久精品免费观看国产蜜| 成人免费毛片高清视频| 91一区一区三区| 欧美日韩在线精品一区二区三区激情| 欧美性大战久久久久久久| 欧美日韩国产片| 日韩精品专区在线影院重磅| 欧美videos大乳护士334| 久久蜜桃av一区二区天堂 | 欧美精品在线一区二区三区| 欧美日韩成人综合在线一区二区| 欧美久久久影院| 日韩欧美国产电影| 久久影院电视剧免费观看| 国产欧美日韩在线看| 中文字幕一区免费在线观看| 亚洲精品一二三四区| 亚洲成人777| 精品一区二区三区av| 成人午夜免费视频| 欧美在线色视频| 亚洲与欧洲av电影| 免费欧美日韩国产三级电影| 国产精品自拍av| 91麻豆swag| 日韩午夜精品视频| 欧美国产乱子伦| 亚洲国产欧美另类丝袜| 久久精品国产**网站演员| 国产成人免费视频网站高清观看视频 | 国产.欧美.日韩| 色视频成人在线观看免| 欧美videofree性高清杂交| 国产精品久久国产精麻豆99网站| 亚洲第四色夜色| 韩国毛片一区二区三区| 日本韩国一区二区三区视频| 日韩欧美国产1| 亚洲精品视频观看| 毛片av一区二区三区| 91视频在线看| 久久久久国产免费免费| 亚洲图片一区二区| 国产91在线观看| 91麻豆精品国产自产在线| 国产精品久久网站| 免费成人深夜小野草| 91在线无精精品入口| 日韩女优视频免费观看| 亚洲美女精品一区| 国产一区二区h| 欧美日韩国产区一| 中文字幕一区二区日韩精品绯色| 麻豆高清免费国产一区| 色视频欧美一区二区三区| 国产欧美一二三区| 蜜臀va亚洲va欧美va天堂 | 久久久九九九九| 日韩国产欧美在线视频| 一本在线高清不卡dvd| 亚洲国产精品t66y| 国产一区二区三区日韩| 欧美日韩精品免费| 亚洲青青青在线视频| 国产99久久久精品| 欧美大胆一级视频| 亚洲chinese男男1069| 色综合久久久久网| 国产精品素人视频| 国内精品国产成人| 精品嫩草影院久久| 日韩精品一区第一页| 91丨九色丨尤物| 国产精品成人在线观看| 国产成人综合精品三级| 久久香蕉国产线看观看99| 蜜臀av一级做a爰片久久| 欧美老年两性高潮| 亚洲第一综合色| 欧美日韩午夜精品| 亚洲va欧美va人人爽| 在线看不卡av| 夜夜嗨av一区二区三区网页 | 麻豆精品一二三| 欧美精品777| 亚洲福利视频一区| 91福利社在线观看| 一区二区三区四区不卡在线| 色综合久久久久久久| 一区二区三区四区在线| 在线免费观看成人短视频| 亚洲色图.com| 91国偷自产一区二区三区成为亚洲经典 | 国产精品久久久久久久久晋中| 国产成人亚洲综合色影视| 国产午夜精品一区二区三区视频| 国产成人免费xxxxxxxx| 日本一区二区三区在线不卡| 高清国产一区二区| 国产精品伦理一区二区| 91原创在线视频| 亚洲国产一区在线观看| 欧美日韩一本到| 免费在线欧美视频| 久久精品网站免费观看| 9i在线看片成人免费| 夜夜精品视频一区二区| 欧美一区二区在线免费观看| 国模少妇一区二区三区| 日本一区二区三区视频视频| 91一区在线观看| 无码av免费一区二区三区试看| 欧美一级理论片| 国产精品亚洲成人| 亚洲蜜臀av乱码久久精品| 欧美在线免费视屏| 精品一区二区三区在线视频| 国产精品视频看| 欧美日韩国产美| 精品亚洲国产成人av制服丝袜| 国产精品福利av| 欧美日韩在线播放| 国产一二精品视频| 亚洲视频你懂的| 91精品国产乱| www.亚洲免费av| 免费成人在线视频观看| 中文字幕精品综合| 欧美日韩三级一区| 国产一区二区剧情av在线| 亚洲色图欧美偷拍| 欧美大胆一级视频| 色婷婷久久久综合中文字幕| 免费的国产精品| 亚洲欧美日韩在线| 精品免费一区二区三区| 色域天天综合网| 国产一本一道久久香蕉| 亚洲成av人影院在线观看网| 国产日产欧产精品推荐色 | 99国产精品99久久久久久| 亚洲bdsm女犯bdsm网站| 国产午夜亚洲精品理论片色戒| 欧美日韩亚洲不卡| 成+人+亚洲+综合天堂| 日韩在线一二三区| 中文字幕欧美日本乱码一线二线| 在线电影欧美成精品| 91麻豆精品秘密| 国产成人精品综合在线观看 | 免费在线观看视频一区| 自拍偷拍国产精品| 亚洲精品一线二线三线| 欧美色成人综合| 一本色道亚洲精品aⅴ|