Linux0.11 kernel source code analysis-malloc

Introduction to malloc The `malloc.c` file in Linux kernel version 0.11 implements the memory allocation function. In this version of the Linux kernel, the `malloc.c` file contains kernel-level memory allocation functions for allocating and freeing memory in the kernel. These functions help the kernel manage available memory and allow the kernel to dynamically allocate and […]

Install GMP, NTL, CTMalloc and compile OpenFHE

references: [ABB + 22] Al Badawi A, Bates J, Bergamaschi F, et al. Openfhe: Open-source fully homomorphic encryption library[C]//Proceedings of the 10th Workshop on Encrypted Computing & Applied Homomorphic Cryptography. 2022: 53 -63. openfheorg/openfhe-development Welcome to OpenFHE’s documentation! Install NTL library and compile and test on Ubuntu Install NTL library on Ubuntu Memory Optimization-How to […]

29. Blocked memory management [malloc, free]

There are many ways to implement memory management, but in the end they all need to implement two functions: malloc and free. The malloc function is used for memory application, and the free function is used for memory release. This article implements this through block memory management: It’s just that the allocation direction in the […]

[Regaining C Language] 13. Dynamic Data Organization (1) Dynamic variables (malloc, calloc, realloc, free)

Table of Contents Preface 13. Dynamic data organization 13.1 Dynamic data organization 13.2 Dynamic variables malloc function calloc function realloc function free function Program example Foreword Dynamic data organization in C language refers to dynamically allocating memory space to store data as needed when the program is running. This allows the program to create, modify, […]

The difference between C++ and C language dynamic memory management new and malloc

Table of Contents 1.C language dynamic memory management method 2.Dynamic memory management in C++ 2.1 new and delete operations on built-in types 2.2 New and delete operations of custom types 2.3 Why delete requires [ ] 3.New application space failed 4.operator new and operator delete functions 5.new and delete are implementation principles 5.1 Built-in types […]

Dynamic memory management (malloc calloc realloc free) — C language

Article directory write in front 1. malloc and free functions 1.1 Introduction to malloc function 1.2 Introduction to free function 2. calloc function 3. realloc function 4. Common dynamic memory errors 4.1 Dereference operation on NULL pointer 4.2 Out-of-bounds access to dynamically opened space 4.3 Use free release for non-dynamically allocated memory 4.4 Use free […]

tcmalloc (high concurrency memory pool) simplified version explanation-project

Table of Contents core graph What is a memory pool Why do you need a memory pool? 1. Application efficiency issues ?edit 2. Memory fragmentation Advantages of high-concurrency memory pools High concurrency memory pool using plug-in object pool Align up free linked list span SpanList radix tree High concurrency memory pool design ThreadCache layer CentralCache […]

kdump+crash solves the crash problem and obtains global variables and malloc heap variables

Table of Contents 1. Experimental purpose 2. Experimental steps 3. Global variable analysis ideas 4. Obtain global variables inside the kernel 5. Modular driver global variables 5.1. p command prints modular global variable errors 5.2. sym/rd + struct command parses global variables in xxx.ko 5.3. Use the rd command to parse the global variables in […]

Explanation of dynamic memory management malloc, calloc, realloc and free functions in C language

Table of Contents 1. Why does dynamic memory management exist: 2. Introduction to dynamic memory functions: 1. Dynamically open function-malloc function 1.1. Function declaration and function: 1.2. Function usage examples: 2. Release dynamic space function-free function 2.1. Notes on free function: 2.2. Free function usage examples: 3. Dynamically open function-calloc function 3.1. Declaration and function […]

C language – dynamic memory management (malloc, free, calloc, realloc)

Table of Contents 1. Why does dynamic memory allocation exist? 2. Introduction to dynamic memory functions 2.1 malloc and free malloc example: free example: 2.2 calloc realloc example: 3. Common dynamic memory errors 3.1 Dereference operation on NULL pointer 3.2 Out-of-bounds access to dynamically opened space 3.3 Use free release for non-dynamically allocated memory 3.5 […]