官术网_书友最值得收藏!

Summary

As part of this chapter, we mainly covered the Stack and Heap segments and the way they should be used. After that, we briefly discussed memory-constrained environments and we saw how techniques like caching and memory pools can increase the performance.

In this chapter:

  • We discussed the tools and techniques used for probing both Stack and Heap segments.
  • We introduced debuggers and we used gdb as our main debugger to troubleshoot memory-related issues.
  • We discussed memory profilers and we used valgrind to find memory issues such as leakages or dangling pointers happening at runtime.
  • We compared the lifetime of a Stack variable and a Heap block and we explained how we should judge the lifetime of such memory blocks.
  • We saw that memory management is automatic regarding Stack variables, but it is fully manual with Heap blocks.
  • We went through the common mistakes that happen when dealing with Stack variables.
  • We discussed the constrained environments and we saw how memory tuning can be done in these environments.
  • We discussed the performant environments and what techniques can be used to gain some performance.

The next four chapters together cover object orientation in C. This might at first glance seem to be unrelated to C, but in fact, this is the correct way to write object-oriented code in C. As part of these chapters, you will be introduced to the proper way of designing and solving a problem in an object-oriented fashion, and you will get guidance through writing readable and correct C code.

The next chapter covers encapsulation and the basics of object-oriented programming by providing the required theoretical discussion and examples to explore the topics discussed.

主站蜘蛛池模板: 剑川县| 沂水县| 阜新| 马尔康县| 五原县| 泸溪县| 甘德县| 佛坪县| 陇南市| 读书| 封丘县| 根河市| 罗源县| 太康县| 三台县| 陇川县| 成武县| 太仆寺旗| 西青区| 韶山市| 普陀区| 米泉市| 越西县| 莆田市| 遵义县| 满城县| 沛县| 纳雍县| 平顶山市| 彩票| 筠连县| 涞源县| 义乌市| 峨山| 临颍县| 林西县| 阆中市| 焉耆| 赤水市| 福泉市| 威远县|