Tag:Allocate memory

  • Will var I interface {} = 3 have additional heap memory allocation in go 1.15

    Time:2021-10-15

    First of all, let’s talk about the conclusion: No. In the latest version of go 1.15, an improvement is mentioned in the runtime section: Converting a small integer value into an interface value no longer causes allocation. It means,Converting small integers to interface values no longer requires memory allocation. A small integer is a number […]

  • Redis learning notes (I) string SDS

    Time:2021-10-5

    SDS simple dynamic string. SDS structure: struct sdshdr{ int len;// Record the number of bytes used in the buf array, which is equal to the length of the eight inch string required by SDS int free;// Records the number of unused bytes in the buf array char buf[];// Byte array to hold string } 1. […]

  • Write OS kernel from scratch – implement heap and malloc

    Time:2021-10-1

    Series catalog Preface preparation BIOS boot to real mode GDT and protection mode On virtual memory Load and enter the kernel Display and print Global descriptor table GDT Interrupt processing Virtual memory perfection Implement heap and malloc First kernel thread Multithread switching Lock and multithreading synchronization Enter user status Process implementation system call Simple file […]

  • Create a new virtual machine using virt manager in xshell

    Time:2021-9-16

    Requirement: I want to create a new virtual machine on the Linux physical machine 1. First, install KVM and solve it by yourself~ systemctl status libvirtd virsh version First, check the existing virtual machines virsh list –all Of course, you can use virsh define and virsh start to create a new virtual machine through the […]

  • 027 VEC memory allocation of rust necromancer book

    Time:2021-9-2

    introduce The videos recorded in this series are mainly put on station BRust dead book learning video The source code information related to rust dead book is ingithub.com/anonymousGiga/Rustonomi… VEC memory allocation In the previous section, we wrote a simplified version of unique, and in the later sections, we use unique in the nightly version. Use […]

  • How objects are initialized (IOS)

    Time:2021-8-18

    Pay attention to the warehouse and get updates in time:iOS-Source-Code-Analyze Follow: Draveness · Github We have discussed a lot of problems before, and the article on objc source code series is almost over. In fact, this article on how to initialize objects was originally the first article I wanted to write, but I have to […]

  • Distributed message system: Kafka

    Time:2021-7-7

    preface As a message middleware, Kafka serves the asynchronous transmission of messagesThe function is similar to JMS: the producer puts the message into the queue, and the consumer gets the data from the queueBut it’s totally different Kafka flow chart 1. Producer sends messages by connecting to broker2. Producer delivers messages to a topic3. Messages […]

  • Improve c # code method – (1) operation string

    Time:2021-6-4

    Operate strings correctly introduction:String is a data type that is used frequently.If it is used carelessly, it will pay for the extra performance cost of a string operation.This paper discusses how to operate strings correctly from the following aspects: 1. Make sure to pack as little as possible and avoid writing unnecessary packing codes as […]

  • The growth factor of vector in C + +

    Time:2021-4-12

    We all know what C + + doesvectorThe capacity of will increase automatically with the added elements, but how much does it increase each time? Twice the original? triple? Or how much? Next, let’s study how the growth factor is determined. First of all, I want to elaborate a problemvectorRealization related facts:vectoruseallocatorInstead ofreallocSo, no matter […]

  • Rereading Windows core programming-002-character set

    Time:2021-3-31

    Advantages of using Unicode: It is convenient for data exchange between different languages. Let your exe or DLL file support all languages. Improve the efficiency of application execution。 Windows 2000 is redeveloped with Unicode, and the core part needs Unicode strings. So: WhenparameterIf you pass in an ANSI string, the system will first convert the […]

  • Notes on C / C + + Programming: new and delete operators for dynamic memory in C + +

    Time:2021-3-21

    Dynamic memory allocation in C / C + + refers to the manual memory allocation by the programmer. Where is the dynamically allocated memoryOn the pileAllocation, non static and local variables inOn the stackAllocate memory. What are the applications? One of the purposes of dynamic memory allocation is to allocate variable size memory, except for […]

  • C + + static member variable

    Time:2021-1-27

    executive summary Static member variables belong to a class, not a specific object。 Static member variables must be initialized outside the class declaration. Static member variables allocate memory during initialization and release memory at the end of the program. project content key word static access control yes initialization Out of class initialization Memory allocation timing […]