[Vala] How to prevent gee.HashMap.set from copy the memory and only return the pointer?



Hello

when I try to set an object to HashMap gee.HashMap.set try to copy the
memory of it with _vala_array_dup1 and it not allowed in my case.

public class pcapNode {
    public uchar[] packet;
    public PCap.packet_header* header;
}

var node = new pcapNode();
node.packet = packet;
node.header = &header;
this.map[i] = node;

_tmp34_ = pcap_node_new ();
node = _tmp34_;
_tmp35_ = node;
_tmp36_ = packet;
_tmp36__length1 = packet_length1;
_tmp37_ = (_tmp36_ != NULL) ? _vala_array_dup1 (_tmp36_, _tmp36__length1) :
((gpointer) _tmp36_);

I guess I should define packet as pointer to uchar[] but I didn't success
to do it.

Thanks
Nadav
-- 
הבלוג שלי:
http://nadavvin.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]