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

Re: Pointer math (merging ifs files)



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


memcpy(u_data: s_data: st_size_s)
memcpy(u_data + st_size_s: p_data: st_size_p)
memcpy(u_data + st_size_s + st_size_p: e_data: st_size_e)

Hmmm... if you do that, you'll have to allocate memory to s_data, p_data, and e_data, read the data into that memory, and then copy it to the user space. It would work, but you'd have two copies of everything in memory at once, and you'd have to spend extra CPU cycles copying the memory.


So, it would work, but I wonder why you wouldn't just read it into the user space directly?
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------