Actions
Feature #12754
closedWant to use prepared buffer with `Array#pack`
Status:
Closed
Assignee:
-
Target version:
-
Description
Array#pack
always returns new allocated String
, but sometimes users want to use prepared buffer, especially the packed size is too large.
I often uses Fiddle
to call OS APIs, and encounter this problem as every time.
I recommend to add keyword arguments for the purpose.
buf = '\0'*(32 * 1024 * 1024)
# ...
ary.pack(LONG_FORMAT, buffer: buf, offset: 4 * 1024) # returns `buf`
Actions
Like0
Like0Like0Like0Like0