memory copy

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

memory copy

murthy
How do I make copy of a buffer in lua? 
I have an event buffer and I need to save a part of it. 

Reply | Threaded
Open this post in threaded view
|

Re: memory copy

Parke
On Wed, May 1, 2019 at 4:20 PM Srinivas Murthy
<[hidden email]> wrote:
> How do I make copy of a buffer in lua?
> I have an event buffer and I need to save a part of it.

If your "buffer" is a table, maybe table.move() would work?

https://www.lua.org/manual/5.3/manual.html#pdf-table.move

Reply | Threaded
Open this post in threaded view
|

Re: memory copy

murthy
Its not a table. Closest equivalent was to use the interface from string library.

On Sun, May 5, 2019 at 10:51 AM Parke <[hidden email]> wrote:
On Wed, May 1, 2019 at 4:20 PM Srinivas Murthy
<[hidden email]> wrote:
> How do I make copy of a buffer in lua?
> I have an event buffer and I need to save a part of it.

If your "buffer" is a table, maybe table.move() would work?

https://www.lua.org/manual/5.3/manual.html#pdf-table.move