Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create non-owning IO-buffer #28

Open
2 tasks
harsath opened this issue May 12, 2021 · 0 comments
Open
2 tasks

Create non-owning IO-buffer #28

harsath opened this issue May 12, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@harsath
Copy link
Owner

harsath commented May 12, 2021

Right now, the blueth::IOBuffer which does the non-blocking async networking IO is implemented using a owning buffer, which means, if we pass a memory location with it's size, it copies the entire memory block and owns it.

It's a fine process, but it makes copies(which is good, but sometimes bad and hurts performance in cases where copies are trivially not needed).

Let's create a non-owining Mutable and ReadOnly buffers buffer, we expect one to pass the pointer to the memory location and with it's size and we do the operations on the pointer.

  • Mutable Buffer
    We expect one to pass a pointer to a memory block which is managed by some other thing, with the current_capacity, current_offset and start_pointer
  • Read Only Buffer
    We expect one to pass a pointer to a memory block which is again managed by some other thing, we assume that the life time of the memory block is managed by the thing which created the Read Only Buffer.
@harsath harsath added the enhancement New feature or request label May 12, 2021
@harsath harsath self-assigned this May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant