Tagged articles
6 articles
Page 1 of 1
AI Cyberspace
AI Cyberspace
Mar 25, 2023 · Fundamentals

Mastering C Memory Management: malloc, realloc, memset, memcpy & More

This article explains how C programs allocate, resize, initialize, and transfer memory using functions like malloc, free, realloc, memset, memcpy, memmove, and alloca, and provides coding standards to avoid out‑of‑bounds errors, leaks, and use‑after‑free bugs.

MemcpyStackc++
0 likes · 11 min read
Mastering C Memory Management: malloc, realloc, memset, memcpy & More
Baidu Intelligent Testing
Baidu Intelligent Testing
Mar 28, 2018 · Fundamentals

Common CPU Performance Pitfalls in C/C++ Programs and Their Diagnosis

The article examines common CPU performance pitfalls in C/C++ programs—such as excessive memset, inefficient string copying, improper container usage, lock contention, and heavy I/O logging—provides concrete code examples, compares profiling tools, and recommends best practices to reduce CPU consumption.

CPU profilingLocksmemset
0 likes · 14 min read
Common CPU Performance Pitfalls in C/C++ Programs and Their Diagnosis