Code Monkey home page Code Monkey logo

yurongos's Introduction

Hi there 👋

✨ Welcome to my page! 🥳

I'm GTY,
Currently a senior student in Tongji University, Majored in Computer Science.

🐣 Favorite Languages

Most favorites: Kotlin java C C++ ts

Currently learning: rust

Also: python

🔧 Favorite Frameworks

Mobile: android

Frontend: react WeChat MiniProgram

Backend: sb

💿 Favorite OS

Daily: win

Development: archlinux

Console: ubuntu

Production Server: ubuntu

👨‍💻 GitHub Activities

Social Media

小红书:枫云树

CSDN:枫铃树

Hits

yurongos's People

Contributors

flowerblackg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

remi356

yurongos's Issues

中断隐指令保存结构错误

涉及部分:X86Assembly -> struct HardwareContextRegisters

rbp来自软件压入。在栈上,errcode为软件压入的假code时,会在rbp上方。为硬件压入时,会在rbp下方。代码内硬件现场保存部分没有正确处理此问题。

memcpy_aligned 未处理拷贝大小无法整除机器字长时的情况。

例如,机器字长为8字节,需要拷贝的长度为26字节,则在拷贝完24字节后,memcpy_aligned 会直接结束,导致最后2字节未被拷贝。

src/lib/string.cpp

static inline void* memcpy_aligned(void* dest, const void* src, size_t count) {
    char* pDest = (char*) dest;
    char* pSrc = (char*) src;
    while (pSrc < ((char*) src) + count && (intptr_t(pSrc) & (sizeof(long) - 1))) {
        *pDest++ = *pSrc++;
    }

    while (pSrc + sizeof(long) - 1 < ((char*) src) + count) {
        *(long*) pDest = *(long*) pSrc;
        pSrc += sizeof(long);
        pDest += sizeof(long);
    }
    
    return dest;
           ^~~~ 可能导致少拷贝数据。

}

void* memcpy(void* dest, const void* src, size_t count) {

    // 如果 src 和 dest 可以互相对齐,则使用快速拷贝。
    if (!((intptr_t(dest) ^ intptr_t(src)) & (sizeof(long) - 1))) {
        return memcpy_aligned(dest, src, count);
    }

    // 单字节拷贝。
    char* pDest = (char*) dest;
    char* pSrc = (char*) src;
    while (pSrc < ((char*) src) + count) {
        *pDest++ = *pSrc++;
    }

    return dest;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.