mirror of
https://github.com/sheumann/hush.git
synced 2025-01-02 09:31:26 +00:00
explain why we use mmap instead of malloc
This commit is contained in:
parent
8723a94c25
commit
8003e266ed
@ -22,6 +22,8 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
|
|||||||
char *buffer;
|
char *buffer;
|
||||||
int buffer_size;
|
int buffer_size;
|
||||||
|
|
||||||
|
/* We want page-aligned buffer, just in case kernel is clever
|
||||||
|
* and can do page-aligned io more efficiently */
|
||||||
buffer = mmap(NULL, CONFIG_FEATURE_COPYBUF_KB * 1024,
|
buffer = mmap(NULL, CONFIG_FEATURE_COPYBUF_KB * 1024,
|
||||||
PROT_READ | PROT_WRITE,
|
PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANON,
|
MAP_PRIVATE | MAP_ANON,
|
||||||
|
Loading…
Reference in New Issue
Block a user