malloc.c
来自「T-kernel 的extension源代码」· C语言 代码 · 共 63 行
C
63 行
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * malloc.c (libtkse) * * Local memory allocation */#include "libtkse.h"void* malloc( size_t size ){ void *p; MEMLOCK( return NULL ) p = _mem_malloc(size, &_Lmacb); MEMUNLOCK(); return p;}void* calloc( size_t nmemb, size_t size ){ void *p; MEMLOCK( return NULL ) p = _mem_calloc(nmemb, size, &_Lmacb); MEMUNLOCK() return p;}void* realloc( void *ptr, size_t size ){ void *p; MEMLOCK( return NULL ) p = _mem_realloc(ptr, size, &_Lmacb); MEMUNLOCK() return p;}void free( void *ptr ){ MEMLOCK( return ) _mem_free(ptr, &_Lmacb); MEMUNLOCK()}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?