📄 malloc.html
字号:
<HTML><HEAD>
<TITLE>Data Structures and Algorithms: Memory Allocators</TITLE>
<META name="description" content="Data Structures and Algorithms Course Notes,
PLDS210 University of Western Australia">
<META name="keywords" content="data structures,algorithms,abstract data types ">
</HEAD>
<BODY BGCOLOR="#ffffff">
<TABLE BGCOLOR="#00c0f0" WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
<TR BGCOLOR="#00f0f0"><TD ALIGN=right>
<FONT FACE=helvetica SIZE=+1><I>Data Structures and Algorithms</I></FONT>
</TD></TR>
<TR><TD><FONT FACE=helvetica SIZE=+2><B>Memory Allocators</B></FONT>
</TD></TR>
</TABLE>
<P>
C implementations provide a number of memory allocation functions
which allocate memory from the program's <i>heap</i>.
This is usually an area of memory above the program and data blocks
which grows upwards in memory as memory is allocated by program
requests.
<p>
The two most commonly used C functions are <tt><FONT COLOR=green>malloc</FONT></tt> and
<tt><FONT COLOR=green>calloc</FONT></tt>.
<p>
Full descriptions may be found in the Unix man pages
for malloc and calloc.
<CENTER>
<IMG SRC="prog_heap.gif" tppabs="http://www.ee.uwa.edu.au/~plsd210/ds/fig/prog_heap.gif"><BR>
Fig 1 A typical program's use of memory.
</CENTER>
<P>
<TABLE CELLPADDING=5 WIDTH="100%" BGCOLOR="#00f0f0" CELLSPACING=0>
<TR><TD>
Back to the <A HREF="ds_ToC.html" tppabs="http://www.ee.uwa.edu.au/~plsd210/ds/ds_ToC.html">Table of Contents</A>
</TD></TR></TABLE>
<SMALL>
© <A HREF=mailto:morris@ee.uwa.edu.au>John Morris</A>, 1998
</SMALL>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -