dm642 cÔËÐпâµÄmalloc·ÖÎö
cÔËÐпâmalloc·ÖÅäµÄÄÚ´æÔÚÄÄÀïÄØ£¬Ê×ÏÈÉÏ´úÂ룺
//ÄÚ´æ´óСÁ¬½ÓÆ÷½«ÆäµØÖ·Ö¸Ïò-heapÑ¡Ïî
extern _DATA_ACCESS int _SYSMEM_SIZE;
//ÄÚ´æÇøÓò
#pragma DATA_SECTION(_sys_memory, ".sysmem")
far PACKET _sys_memory[1] = { ((size_t)&_SYSMEM_SIZE) - sizeof(PACKET), 0 };
ÔÚbiosÉèÖÃÀïÃ棬system--->mem->property->general, segment for malloc() / free(), ÉèÖóÉSDRAM£» ÔÚbiosÉèÖÃÀïÃ棬system--->mem->property->general, segment for malloc() / free(), ÉèÖóÉSDRAM£»Òâ˼ÊÇʵÏÖ±ê×¼CµÄmalloc/freeµÈº¯Êý£¨ÈçMEM_alloc£©À´ÉêÇëºÍÊÍ·ÅÄÚ´æ¡£²Î¿¼spru403q.pdf£¬page269
Ïà¹ØÎĵµ£º
51µ¥Æ¬»ú Keil C ÑÓʱ³ÌÐòµÄ¼òµ¥Ñо¿
by: InfiniteSpace Studio/isjfk, 1.21.2004
ÈκÎÈ˶¼¿ÉÒÔÔÚ×¢Ã÷Ô×÷Õߺͳö´¦µÄÇ°ÌáÏÂËæÒâתÔØÕâƪÎÄÕ£¬µ«²»µÃÓÃÓÚÉÌҵĿµÄ¡£
......
½ñÌ죬ÔÚÉè¼ÆC´úÂëµÄʱºò£¬Ïëµ½ÁËÒ»µã£¬ÏëÈÃB°üº¬A£¬²¢×ÔÓÉʹÓÃAµÄÍ·Îļþ£¬µ«ÊÇÈ´²»ÏëÈðüº¬BµÄCʹÓÃA£¬ÈÃAûÓÐȨÏÞÖ±½ÓʹÓÃʹÓÃC……ÈçÏÂͼ£º
²»ÖªµÀÓ¦¸ÃÔõô°ì¡£µ±Ê±ÐÄÏ룬Èç¹ûÊÇC++£¬Ê¹Óü̳У¬ºÜÁé»î¾ÍÄܸ㶨ÕâЩÊÂ
¸úͬÊÂÉÌÁ¿ÁËһϣ¬¶Ô·½¸ø³öÁË ......
ÔÚµ±½ñǶÈëʽ“ÎäÁÖ”ÖУ¬Á÷´«×ż¸±¾ÈËÈ˶¼Ïë͵ѧ¼¸ÕеÄCÓïÑÔµÄÎ书Ãؼ®¡£ÕâЩÃؼ®¶¼ÊÇ¿õÊÀÎäѧÆæ²ÅºÄ¾¡±ÏÉú¾«Á¦ËùÖø£¬²¿·ÖÃؼ®Á÷¾ÊýÊ®ÔØÈÔ¾¾Ã²»Ë¥£¬ÈÃËüµÄÎÞÊýʵϰÕßÊÜÒæ·Ëdz¡£¡¡¡¡½ñÌ죬³ÐÃÉÎäÁÖ´ó»áËùÍÏ£¬ÔÚÕ⹫²¼Õ⼸±¾¹ØÓÚCµÄ“¾Ê锣¬Èøü¶àÈËʵϰ֮£¬Á·¾ÍÒ»Éí¾øÊÀµÄǶÈëʽCÓïÑԺù¦·ò¡£Î书à ......
1. ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL
ÎÒÔÚÕâÏë¿´µ½¼¸¼þÊÂÇ飺
1). #define Óï·¨µÄ»ù±¾ÖªÊ¶£¨ÀýÈ磺²»ÄÜÒԷֺŽáÊø£¬À¨ºÅµÄʹÓ㬵ȵȣ©
2). ¶®µÃÔ¤´¦ÀíÆ÷½«ÎªÄã¼ÆËã³£Êý±í´ïʽµÄÖµ£¬Òò´Ë£¬Ö±½Óд³öÄãÊÇÈçºÎ¼ÆËãÒ»ÄêÖÐÓж ......
clock()·µ»Øclock_tÀàÐÍ£»
ÔÚtime.hÍ·ÎļþÖУ¬¶¨ÒåÁË typedef long clock_t
clock()ÊÇÓÃÀ´¼ÆËãÁ½¸öʱ¼äµãÖ®¼äµÄʱ¼ä¼ä¸ô¡£ÈçϳÌÐò£º
#include <stdio.h>
int main()
{
int i = 0;
clock_t start_time, end_time;
start_time = clock(); //¿ªÊ¼¼Æʱ, start_time = 0
while( ......