Question: (2pts) Consider the following code in the kernel space for swapping the contents of two non- overlapping 4kb arrays: 1: void swap4kb(void* a, void* b)

(2pts) Consider the following code in the kernel space for swapping the contents of two non- overlapping 4kb arrays: 1: void swap4kb(void* a, void* b) { 2: char tmp[4096]; 3: assert(a != NULL); 4: assert(b != NULL); 5: memcpy(tmp, a, 4096); 6: memcpy(a, b, 4096); 7: memcpy(b, tmp, 4096); 8: } Describe any bug(s) you see, if any
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
