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

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

?? align.c

?? C語言庫函數的原型,有用的拿去
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***
*align.c - Aligned allocation, reallocation or freeing of memory in the heap
*
*       Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
*       Defines the _aligned_malloc(),
*                   _aligned_realloc(),
*                   _aligned_recalloc(),
*                   _aligned_offset_malloc(),
*                   _aligned_offset_realloc(),
*                   _aligned_offset_recalloc(),
*                   _aligned_free(),
*                   _aligned_msize() functions.
*
*******************************************************************************/

#include <dbgint.h>
#include <crtdbg.h>
#include <errno.h>
#include <string.h>
#include <malloc.h>
#include <stddef.h>
#include <stdlib.h>
#include <internal.h>

#define IS_2_POW_N(X)   (((X)&(X-1)) == 0)
#define PTR_SZ          sizeof(void *)
/***
*
* |1|___6___|2|3|4|_________5__________|_6_|
*
* 1 -> Pointer to start of the block allocated by malloc.
* 2 -> Value of 1.
* 3 -> Gap used to get 1 aligned on sizeof(void *).
* 4 -> Pointer to the start of data block.
* 4+5 -> Data block.
* 6 -> Wasted memory at rear of data block.
* 6 -> Wasted memory.
*
*******************************************************************************/

/***
* void *_aligned_malloc_base(size_t size, size_t alignment)
*       - Get a block of aligned memory from the heap.
*
* Purpose:
*       Allocate of block of aligned memory aligned on the alignment of at least
*       size bytes from the heap and return a pointer to it.
*
* Entry:
*       size_t size - size of block requested
*       size_t alignment - alignment of memory (needs to be a power of 2)
*
* Exit:
*       Success: Pointer to memory block
*       Failure: Null, errno is set
*
* Exceptions:
*       Input parameters are validated. Refer to the validation section of the function.
*
*******************************************************************************/

void * __cdecl _aligned_malloc_base(
    size_t size,
    size_t alignment
    )
{
    return _aligned_offset_malloc_base(size, alignment, 0);
}
/***
* void *_aligned_offset_malloc_base(size_t size, size_t alignment, int offset)
*       - Get a block of memory from the heap.
*
* Purpose:
*       Allocate a block of memory which is shifted by offset from alignment of
*       at least size bytes from the heap and return a pointer to it.
*
* Entry:
*       size_t size - size of block of memory
*       size_t alignment - alignment of memory (needs to be a power of 2)
*       size_t offset - offset of memory from the alignment
*
* Exit:
*       Success: Pointer to memory block
*       Failure: Null, errno is set
*
* Exceptions:
*       Input parameters are validated. Refer to the validation section of the function.
*
*******************************************************************************/


void * __cdecl _aligned_offset_malloc_base(
    size_t size,
    size_t align,
    size_t offset
    )
{
    uintptr_t ptr, retptr, gap;
    size_t nonuser_size,block_size;

    /* validation section */
    _VALIDATE_RETURN(IS_2_POW_N(align), EINVAL, NULL);
    _VALIDATE_RETURN(offset == 0 || offset < size, EINVAL, NULL);

    align = (align > PTR_SZ ? align : PTR_SZ) -1;

    /* gap = number of bytes needed to round up offset to align with PTR_SZ*/
    gap = (0 - offset)&(PTR_SZ -1);

    nonuser_size = PTR_SZ +gap +align;
    block_size = nonuser_size + size;
    _VALIDATE_RETURN_NOEXC(size <= block_size, ENOMEM, NULL)

    if ( (ptr =(uintptr_t)malloc(block_size)) == (uintptr_t)NULL)
        return NULL;

    retptr =((ptr +nonuser_size+offset)&~align)- offset;
    ((uintptr_t *)(retptr - gap))[-1] = ptr;

    return (void *)retptr;
}

/***
*
* void *_aligned_realloc_base(void * memblock, size_t size, size_t alignment)
*       - Reallocate a block of aligned memory from the heap.
*
* Purpose:
*       Reallocates of block of aligned memory aligned on the alignment of at
*       least size bytes from the heap and return a pointer to it. Size can be
*       either greater or less than the original size of the block.
*       The reallocation may result in moving the block as well as changing the
*       size.
*
* Entry:
*       void *memblock - pointer to block in the heap previously allocated by
*               call to _aligned_malloc(), _aligned_offset_malloc(),
*               _aligned_realloc() or _aligned_offset_realloc().
*       size_t size - size of block requested
*       size_t alignment - alignment of memory
*
* Exit:
*       Success: Pointer to re-allocated memory block
*       Failure: Null, errno is set
*
* Exceptions:
*       Input parameters are validated. Refer to the validation section of the function.
*
*******************************************************************************/

void * __cdecl _aligned_realloc_base(
    void *memblock,
    size_t size,
    size_t alignment
    )
{
    return _aligned_offset_realloc_base(memblock, size, alignment, 0);
}

/***
*
* void *_aligned_recalloc_base(void * memblock, size_t count, size_t size, size_t alignment)
*       - Reallocate a block of aligned memory from the heap.
*
* Purpose:
*       Reallocates of block of aligned memory aligned on the alignment of at
*       least size bytes from the heap and return a pointer to it. Size can be
*       either greater or less than the original size of the block.
*       The reallocation may result in moving the block as well as changing the
*       size.
*
* Entry:
*       void *memblock - pointer to block in the heap previously allocated by
*               call to _aligned_malloc(), _aligned_offset_malloc(),
*               _aligned_realloc() or _aligned_offset_realloc().
*       size_t count - count of items
*       size_t size - size of item
*       size_t alignment - alignment of memory
*
* Exit:
*       Success: Pointer to re-allocated memory block
*       Failure: Null, errno is set
*
* Exceptions:
*       Input parameters are validated. Refer to the validation section of the function.
*
*******************************************************************************/

void * __cdecl _aligned_recalloc_base(
    void *memblock,
    size_t count,
    size_t size,
    size_t alignment
    )
{
    return _aligned_offset_recalloc_base(memblock, count, size, alignment, 0);
}

/***
*
* void *_aligned_offset_realloc_base (void * memblock, size_t size,
*                                     size_t alignment, int offset)
*       - Reallocate a block of memory from the heap.
*
* Purpose:
*       Reallocates a block of memory which is shifted by offset from
*       alignment of at least size bytes from the heap and return a pointer
*       to it. Size can be either greater or less than the original size of the
*       block.
*
* Entry:
*       void *memblock - pointer to block in the heap previously allocated by
*               call to _aligned_malloc(), _aligned_offset_malloc(),
*               _aligned_realloc() or _aligned_offset_realloc().
*       size_t size - size of block of memory
*       size_t alignment - alignment of memory
*       size_t offset - offset of memory from the alignment
*
* Exit:
*       Success: Pointer to re-allocated memory block
*       Failure: Null, errno is set
*
* Exceptions:
*       Input parameters are validated. Refer to the validation section of the function.
*
*******************************************************************************/

void * __cdecl _aligned_offset_realloc_base(
    void *memblock,
    size_t size,
    size_t align,
    size_t offset
    )
{
    uintptr_t ptr, retptr, gap, stptr, diff;
    uintptr_t movsz, reqsz;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品欧美一级免费| 日本韩国精品在线| 成人国产精品免费观看动漫| 日韩一级视频免费观看在线| 亚洲6080在线| 国产欧美日韩三级| 欧美一级日韩免费不卡| 99久久国产综合精品女不卡 | 国产精品国产三级国产专播品爱网 | 中文字幕一区二区三区精华液 | 亚洲天堂福利av| 精品日韩99亚洲| 欧美性极品少妇| 成人网男人的天堂| 精品一区二区三区蜜桃| 亚洲一区二区三区中文字幕| 国产精品色婷婷| 亚洲精品在线三区| 欧美日韩大陆一区二区| 91视频免费播放| 国产suv精品一区二区6| 韩国三级在线一区| 日韩vs国产vs欧美| 亚洲成人1区2区| 亚洲美女在线一区| 久久精品人人做人人爽人人| 欧美一区二区三区四区在线观看| 色94色欧美sute亚洲13| 成人av免费在线播放| 精品亚洲成a人在线观看| 日韩av一区二区三区四区| 亚洲国产精品欧美一二99| 亚洲青青青在线视频| 中文字幕成人av| 久久影院视频免费| 欧美tk—视频vk| 日韩欧美国产一二三区| 日韩一区和二区| 91精品国产综合久久久久久久 | 国产日产欧美一区| 久久久久国产精品免费免费搜索| 欧美一区二区三级| 6080日韩午夜伦伦午夜伦| 欧美男生操女生| 欧美疯狂做受xxxx富婆| 欧美日韩极品在线观看一区| 欧美精品视频www在线观看| 欧美在线观看你懂的| 日本大香伊一区二区三区| 色欧美日韩亚洲| 欧美在线free| 欧美群妇大交群的观看方式| 91精品国产色综合久久久蜜香臀| 欧美丰满一区二区免费视频 | 99久久精品情趣| 一本到三区不卡视频| 在线免费观看日本一区| 在线免费观看日本欧美| 欧美日韩国产在线播放网站| 欧美丰满高潮xxxx喷水动漫| 欧美一区二区在线观看| 欧美成人aa大片| 久久精品一区蜜桃臀影院| 中文字幕一区在线观看| 一区二区三区四区在线| 香蕉久久一区二区不卡无毒影院| 日韩av在线发布| 国产成都精品91一区二区三| 99精品国产99久久久久久白柏 | 国产亚洲欧美激情| 国产精品成人午夜| 亚洲一区二区三区小说| 久色婷婷小香蕉久久| 成熟亚洲日本毛茸茸凸凹| 色综合久久中文综合久久97| 欧美久久久久久久久久| 亚洲精品一区二区在线观看| 成人欧美一区二区三区白人| 亚洲成人黄色小说| 国产美女一区二区| 91丨九色丨国产丨porny| 欧美久久久一区| 日本一区二区不卡视频| 一区二区三区免费网站| 久草在线在线精品观看| 91色九色蝌蚪| 日韩午夜三级在线| 中文字幕日韩欧美一区二区三区| 亚洲成人av在线电影| 国产**成人网毛片九色 | 中文字幕精品综合| 亚洲福利一二三区| 国产传媒日韩欧美成人| 欧美日韩在线精品一区二区三区激情| 日韩一区二区不卡| 一区二区三区在线不卡| 国产一区二区三区免费播放| 欧美在线高清视频| 中国av一区二区三区| 日韩1区2区日韩1区2区| 91视视频在线观看入口直接观看www| 日韩女优电影在线观看| 亚洲精品一二三四区| 国产激情视频一区二区三区欧美 | 免费人成在线不卡| 99re8在线精品视频免费播放| 精品欧美久久久| 亚洲国产日产av| 不卡在线观看av| 久久综合九色综合欧美亚洲| 五月婷婷另类国产| 91免费视频大全| 国产亚洲精品资源在线26u| 天天亚洲美女在线视频| 99久久免费精品| 中文乱码免费一区二区| 久热成人在线视频| 欧美日韩高清在线| 亚洲精品国产无天堂网2021 | 蜜桃久久久久久| 91行情网站电视在线观看高清版| 欧美国产97人人爽人人喊| 久久国产人妖系列| 69久久夜色精品国产69蝌蚪网| 亚洲欧洲综合另类在线| 成人毛片老司机大片| 久久久久97国产精华液好用吗| 久久国产尿小便嘘嘘尿| 日韩一区二区三区视频| 日韩av网站免费在线| 欧美男同性恋视频网站| 亚洲 欧美综合在线网络| 91搞黄在线观看| 亚洲自拍偷拍网站| 精品视频一区二区三区免费| 亚洲一区二区三区四区在线免费观看| 91社区在线播放| 伊人性伊人情综合网| 一本色道久久综合精品竹菊| 亚洲女女做受ⅹxx高潮| 一本到不卡精品视频在线观看| 亚洲欧美怡红院| 日本精品视频一区二区三区| 亚洲精品国产一区二区精华液| 91视视频在线观看入口直接观看www | 欧洲在线/亚洲| 亚洲bdsm女犯bdsm网站| 欧美一区二区高清| 韩日欧美一区二区三区| 国产亚洲成av人在线观看导航| 国产九九视频一区二区三区| 国产网站一区二区三区| 成人动漫一区二区三区| 亚洲视频一区二区免费在线观看| 91女神在线视频| 五月综合激情婷婷六月色窝| 欧美成人女星排名| 丰满岳乱妇一区二区三区| 中文字幕一区av| 欧美在线视频不卡| 蜜桃av噜噜一区二区三区小说| 日韩视频免费直播| 成人精品亚洲人成在线| 亚洲天天做日日做天天谢日日欢| 日本久久电影网| 婷婷久久综合九色综合绿巨人| 日韩欧美激情在线| 成人激情小说网站| 亚洲黄网站在线观看| 91精品国产欧美一区二区| 国产剧情在线观看一区二区| 椎名由奈av一区二区三区| 9191久久久久久久久久久| 国产综合色产在线精品| 亚洲视频1区2区| 91精品欧美综合在线观看最新 | 国产麻豆精品久久一二三| 国产精品乱人伦中文| 欧美日韩高清影院| 国产美女av一区二区三区| 亚洲天堂中文字幕| 555www色欧美视频| 成人黄色小视频| 日韩精品每日更新| 日本一区二区成人在线| 欧美日韩精品一区视频| 国产白丝网站精品污在线入口| 亚洲一区中文在线| 久久在线观看免费| 欧美亚洲综合久久| 成人性生交大片免费看中文| 日韩激情一区二区| 亚洲欧洲三级电影| 欧美tk丨vk视频| 欧美三日本三级三级在线播放| 国产麻豆成人传媒免费观看| 亚洲图片欧美一区| 日韩一区有码在线| 久久看人人爽人人| 3d动漫精品啪啪一区二区竹菊|