Re: [Vala] how to *not* automagically copy arrays passed to methods?
- From: Luca Bruno <lethalman88 gmail com>
- To: Matto Marjanovic <maddog mir com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] how to *not* automagically copy arrays passed to methods?
- Date: Wed, 21 Dec 2011 07:53:55 +0100
On Wed, Dec 21, 2011 at 6:18 AM, Matto Marjanovic <maddog mir com> wrote:
Ok, another bonus question (see revised subject) --- and I think this
issue was the root of the misfire with my earlier experiments with slices:
How does one tell valac to *not* copy arrays that are passed to methods?
For example:
public void foo(uint8[] x) {
...
x[0] = 7;
...
}
The generated C code for the method duplicates the array x before executing
the body of the method; hence the common case of a method which modifies a
buffer, returning with side-effects, doesn't work.
What are you talking about? It's not copied.
--
www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]