The essence of the cache and memory function memoize

I am participating in the “Nuggets·Starting Plan” Foreword Memory functions, that is, functions with caching capabilities. For ordinary calculation functions, more space is exchanged for time, which has certain advantages in a large number of complex calculation scenarios (long recursive or long iterative operations) Just look at an example function add(a, b) {<!– –> return […]

Linux interprocess communication – shared memory

Author: Lingmo Blog homepage: Lingmo’s blog Column: Linux system programming, file knowledge and understanding, Linux process learning… If you think the blogger wrote well, I hope everyone will keep repeating (?Follow,?Like,?Comment), please support me a lot! ! Table of Contents Shared memory principle shared memory function Shared memory related instructions Shared memory code display Shared […]

String function + memory function

String function + memory function The previous blog has introduced most of the string functions. This blog first supplements the remaining string functions, and then mainly introduces the memory functions. 1. String function 1. strtok char * strtok ( char * str, const char * sep ); The sep parameter is a string, which defines […]

Linux kernel: memory management – zone data structure

Undertake concepts related to memory management and explain related data structures. There are pg_data_t: represents the node; zone: memory domain; page: page frame; struct zone { /* Read-mostly fields */ unsigned long watermark[NR_WMARK]; unsigned long nr_reserved_highatomic; /* * We don’t know if the memory that we’re going to allocate will be * freeable or/and it […]