8.4 Automatic memory management
来源:互联网 发布:linux提权命令 编辑:程序博客网 时间:2024/06/10 01:20
8.4 Automatic memory management
Manual memory management requires developers to manage the allocation and
de-allocation of blocks of
memory. Manual memory management can be both time-consuming and difficult.
In C#, automatic memory
management is provided so that developers are freed from this burdensome
task. In the vast majority of
cases, automatic memory management increases code quality and enhances
developer productivity without
negatively impacting either expressiveness or performance.
The example
using System;
public class Stack
{
private Node first = null;
public bool Empty {
get {
return (first == null);
}
}
public object Pop() {
if (first == null)
throw new Exception("Can’t Pop from an empty Stack.");
else {
object temp = first.Value;
first = first.Next;
return temp;
}
}
Manual memory management requires developers to manage the allocation and
de-allocation of blocks of
memory. Manual memory management can be both time-consuming and difficult.
In C#, automatic memory
management is provided so that developers are freed from this burdensome
task. In the vast majority of
cases, automatic memory management increases code quality and enhances
developer productivity without
negatively impacting either expressiveness or performance.
The example
using System;
public class Stack
{
private Node first = null;
public bool Empty {
get {
return (first == null);
}
}
public object Pop() {
if (first == null)
throw new Exception("Can’t Pop from an empty Stack.");
else {
object temp = first.Value;
first = first.Next;
return temp;
}
}
- 8.4 Automatic memory management
- 8.4 Automatic memory management(cont')
- 10.9 Automatic memory management
- Using Automatic Memory Management
- Automatic Shared Memory Management(ASMM)
- Oracle 11g Automatic Memory Management
- Automatic Memory Management(AMM)…
- 理解自动内存管理(Automatic Memory Management)
- Garbage Collection: Algorithms for Automatic Dynamic Memory Management
- Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework
- C#自动化的内存管理(Automatic memory management)
- C#自动化的内存管理(Automatic memory management)
- compiler之automatic memory management以及Java GC
- Oracle 11g internals part 1: Automatic Memory Management
- Oracle 11g internals part 1: Automatic Memory Management
- Oracle 11g internals part 1: Automatic Memory Management
- 39 Which statement about Automatic Memory Management with Oracle 11g is true?
- QUESTION 56 Automatic Shared Memory Management is disabled for your database instance. You realize t
- 从国内首例禽流感假疫苗大案说起——有感于李开复《做最好的自己》中的诚信观
- 全部乱套了...
- 测试
- 8.3 Variables and parameters
- 8.3 Variables and parameters(cont')
- 8.4 Automatic memory management
- 8.4 Automatic memory management(cont')
- My currently using blog
- 笔记
- 川西云南行散记之十《虎跳-丽江-沪沽湖》
- 川西云南行散记之十一《沪沽湖》
- ADO连接数据库字符串大全
- 差距
- 启用ie5的java控制台