📄 mbrk.c
字号:
/****************************************************************
Copyright 1988 Software Development Systems, Inc.
This is the default mbrk() function, used with malloc()
and calloc(). This mbrk() will succeed the first time
it gets a request for a memory section with no more than
_brksz bytes, and in that case returns the section
indicated by _brkp,_brksz. All other times this
function returns 0. The code in "start.s" initializes
_brkp,_brksz to the address and size of the region
"malloc" declared in the link specification file "spec".
****************************************************************/
#include "alloc.h"
extern void *_brkp;
extern long _brksz;
char *mbrk( long size, long *realsize ) {
if ( size > _brksz ) return 0;
*realsize = _brksz;
_brksz = 0;
return _brkp; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -