Hey,

(this goes probably to Martine)

The docs of ng_pktbuf_add say:

"If @p data is already in the packet buffer (e.g. a payload of an
already allocated packet) it will not be duplicated."

Does this check for pointer equality, or would it correctly de-duplicate
the snip if I add e.g., just the end of a packet a second time?

e.g.
pkt = ng_pktbuf_add(0,0,size,undef);
memcpy(pkt->data, src, size);

payload = ng_pktbuf_add(pkt, pkt->data + hdr_size, size-hdr_size, hdr_type);

Would this allocate the space for pkt->data + hdr_size a second time?

Kaspar
_______________________________________________
devel mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/devel

Reply via email to