Skip to content

getBytes 内部建议用 memcpy_s 实现 #3

@abevol

Description

@abevol

性能大概有几百倍的差距

    void getBytes(uint8_t* buf, uint32_t  len)
    {
        if (0 == memcpy_s(buf, len, p_buffer_ + position_, remaining()))
            position_ = position_ + len;
    }
    void getBytes(uint32_t index, uint8_t* buf, uint32_t len) const
    {
        memcpy_s(buf, len, p_buffer_ + index, limit_ - index);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions