Project

General

Profile

Actions

Feature #15923

closed

New independent string without memcpy

Added by puchuu (Andrew Aladjev) almost 5 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:93142]

Description

Hello. I've just tried to implement extension for ruby that will provide large binary strings.

I've inspected latest ruby source code and found 2 functions: rb_str_new and rb_str_new_static .

  • rb_str_new allocates new memory and uses memcpy to copy from source string to new memory.
  • rb_str_new_static uses existing source string as it is, but adds STR_NOFREE flag.

Is it possible to create independent string from source string without memcpy that will be freed automatically? Thank you.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0