China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 08:48
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » [Help] What are the requirements for using the malloc function? View 642 Replies 2
Original Poster Posted 2003-11-01 00:00 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 117
Posts 4
Joined 2003-10-30 00:00
22-year member
UID 12166
Gender Male
Status Offline
Floor 2 Posted 2004-05-12 00:00 ·  中国 新疆 喀什地区 电信
初级用户
Credits 125
Posts 11
Joined 2004-05-09 00:00
22-year member
UID 23971
Gender Male
Status Offline
char *buf;
buf=malloc(1024);/* request 1024 bytes*/

alhanhome@21cn.com
Floor 3 Posted 2004-05-12 00:00 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re dte:

On the surface, it seems to be a problem of the allocation size being too large. Although 0xec07 is less than 64K, after adding the code size, it may exceed 64K. If that is really the case, then you can't use the default tiny model to compile the code; you need to switch to a larger memory model.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Forum Jump: