Categories

130 pages

Computer

Automatic System Switchover

Use GitHub Actions to automatically deploy your Hugo blog to GitHub Pages and Gitee.

Background Introduction

Yesterday while updating the blog, I discovered that the travis service was unavailable. Upon checking the travis webpage, I noticed the progress was stuck during source code retrieval, and a flash of insight occurred – I thought about GitHub’s previously launched action service.

Due to being busy at the time and also needing to apply for access to use action, it has now officially gone live. With some free weekend time, I decided to try out a new toy?

Standard Library Container Memory Allocators: allocator

A custom allocator can improve performance, increase memory utilization efficiency, and address the issue of frequent, small memory allocations.

Antecedent

Recently, I’ve been working on the development of network data packets, requiring frequent allocation and release of small blocks of memory. Initially, I considered using a memory pool, reviewing several existing ones and discovering this: https://github.com/cacay/MemoryPool When looking at the interface, I was quite puzzled by how the memory pool’s implementation was a bit strange. The MemoryPool implementation logic involves allocating fixed-size memory blocks. Having reviewed Boost’s memory pool interface, it provides a template that is instantiated when used. Fortunately, this library already had an article describing it, mentioning the concept of an ‘allocator’.