Skip to content

Commit b13f0bf

Browse files
committed
update slide
1 parent 18c9524 commit b13f0bf

File tree

8 files changed

+13
-3
lines changed

8 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| 2019-10-25 | 环境搭建和C语言入门 | [introduction.pdf](https://github.com/tangruize/programming-tutorial-2019/releases/download/slide_1/introduction.pdf) |
1818
| 2019-11-01 | 调试技巧, 函数和数组 | [function_array.pdf](https://github.com/tangruize/programming-tutorial-2019/releases/download/slide_2/function_array.pdf) |
1919
| 2019-11-08 | 指针和动态内存 | [pointer_memory.pdf](https://github.com/tangruize/programming-tutorial-2019/releases/download/slide_3/pointer_memory.pdf) |
20+
| 2019-11-16 | 结构体和malloc实现 | [struct_malloc.pdf](https://github.com/tangruize/programming-tutorial-2019/releases/download/slide_4/struct_malloc.pdf) |
2021

2122
## [Tutorial](Tutorial)
2223

Slides/2019-11-15_Struct_Malloc/sections/malloc.tex renamed to Slides/2019-11-16_Struct_Malloc/sections/malloc.tex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ \section{malloc实现}\label{sec:malloc实现}
7171

7272
\begin{frame}[fragile]{malloc实验教程}
7373
\begin{itemize}[<+- | alert@+>]
74-
\item 下载 \href{http://problemoverflow.top/download/my\_malloc.zip}{my\_malloc.zip}, 解压后在 CLion 打开.
75-
\item 由于使用了 Windows 不原生支持的 sbrk() 等函数, 请在 Linux 环境或 Cygwin 环境下进行实验 (MinGW 不能用)
74+
\item 下载 \href{http://problemoverflow.top/download/my\_malloc.zip}{my\_malloc.zip}
7675
\item 编译运行test, 程序使用的标准库 malloc()
7776
\item 在 test.c 中找到并取消注释 \texttt{//\#define USE\_MY\_MALLOC}
77+
\item 如果你使用的 Linux 环境或 Cygwin, 可以注释掉 \texttt{\#define NOT\_UNIX} (在 my\_malloc.h)
7878
\item 编译运行test, 程序给出提示并异常退出
7979
\item TODO: 你需要在 my\_malloc.c 文件实现 allocate\_more\_chunk() 相关代码
8080
\end{itemize}
@@ -139,4 +139,13 @@ \section{malloc实现}\label{sec:malloc实现}
139139
\item 能不能 free() 同一个指针两次?
140140
\item 好像越界一点点没问题?
141141
\end{itemize}
142+
\end{frame}
143+
144+
\begin{frame}[fragile]{更多资料}
145+
\begin{itemize}[<+- | alert@+>]
146+
\item 较好的Linux系统编程书籍: \href{http://www.man7.org/tlpi/toc-detailed.html#ch_7}{tlpi ch7: MEMORY ALLOCATION}
147+
\item 维基百科: \href{https://en.wikipedia.org/wiki/C_dynamic_memory_allocation}{C dynamic memory allocation}
148+
\item 完全使用 mmap() 实现的 malloc(): \href{https://code.woboq.org/userspace/glibc/malloc/tst-interpose-aux.c.html}{tst-interpose-aux.c}
149+
\item 最详细的 glibc 官方文档: \href{http://www.gnu.org/software/libc/manual/html_mono/libc.html#Memory-Allocation}{Memory-Allocation}
150+
\end{itemize}
142151
\end{frame}

Slides/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ add_custom_target(slides-pointer_memory.pdf
2121
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
2222

2323
add_custom_target(slides-struct_malloc.pdf
24-
COMMAND $(MAKE) DIR=2019-11-15_Struct_Malloc
24+
COMMAND $(MAKE) DIR=2019-11-16_Struct_Malloc
2525
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

0 commit comments

Comments
 (0)