from:http://blog.csdn.net/jasonliuvip/article/details/22600569Linux Network Programming IX: Splice function, efficient 0 copiesRecently looking at "Linux High Performance Server Programming", here to do a diary to motivate themselves, while sharing
When writing JS code, we often use the splice function to delete elements in the array, because the splice function modifies the arrays directly, eliminating the need to write an algorithm to move the other elements of the array to the deleted
List::splice to achieve the function of list stitching. Delete the contents of the source list, or all of the elements, into the destination list.
The function has the following three kinds of declarations:
void Splice (iterator position, list& x); /
Objective
Today I revisit the JavaScript, see the array method, there are two of the more similar methods--splice and splice, look like, is more than one P, but the usage is quite different.
In use, you can reduce confusion by selecting an API
List: splice implements list concatenation. Delete part or all of the elements in the source list and insert them to the destination list.
The function has the following three declarations:
Void splice (iterator position, list & X );//
Void
Splice in JavaScript is mainly used to operate arrays in js, including deleting, adding, and replacing arrays. This article describes the detailed usage of the splice method in JavaScript. For more information, see splice in JavaScript. It is mainly
Splice function:
Function Description: it is used to move data between two file descriptors. It is also a zero copy operation. The function is defined as follows:
1 #include 3 ssize_t splice(int fd_in,loff_t* off_t,int fd_out,loff_t*
Splice is a newly added zero-copy data sending function in linux2.6 kernel. It is mainly used to send data to or receive data from the pipeline. Similar to splice, the zero copy sending function also has sendfile. The difference is that sendfile
ArticleDirectory
Syntax
Return Value
Description
Example 1
Example 2
Example 3
Splice, please note that splice is not a split, although the two looks very similar but not a thing.
Splice and not split can be used for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.