Skip to content

Commit

Permalink
buffer: Add BufferBuilder.align()
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Jun 5, 2023
1 parent 5d4389f commit d4069c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/base/buffer.vala
Expand Up @@ -44,6 +44,13 @@ namespace Frida {
return this;
}

public unowned BufferBuilder align (size_t n) {
size_t remainder = cursor % n;
if (remainder != 0)
skip (n - remainder);
return this;
}

public unowned BufferBuilder append_pointer (uint64 val) {
write_pointer (cursor, val);
cursor += pointer_size;
Expand Down

0 comments on commit d4069c7

Please sign in to comment.