|
|
|
зачем нужна ф-ия memcpy() ??
|
|||
|---|---|---|---|
|
#18+
объясните плиз, зачем пользоваться memcpy(), если есть ф-ия memmove(), которая выполнят копирование данных как и memcpy() + корректно работает если области памяти перекрываются ?? попробовал такой код: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. результаты почти всегда такие: testing memcpy(mem1, mem2, sizeof(mem1)): time spent = 40 testing memmove(mem1, mem2, sizeof(mem1)): time spent = 43 разница во времени ничтожна, или я не прав?? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.03.2007, 13:02 |
|
||
|
зачем нужна ф-ия memcpy() ??
|
|||
|---|---|---|---|
|
#18+
RTFM The memcpy() function operates as efficiently as possible on memory areas. It does not check for overflow of any receiving memory area. Specifically, memcpy() copies n bytes from memory area s2 to s1. It returns s1. The memmove() function operates as efficiently as possible on memory areas. It does not check for overflow of any receiving memory area. Specifically, memmove() copies n bytes from memory areas s2 to s1. It returns s1. If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike memcpy()). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.03.2007, 13:13 |
|
||
|
зачем нужна ф-ия memcpy() ??
|
|||
|---|---|---|---|
|
#18+
Tubrikразница во времени ничтожна, или я не прав??Разница зависит от типа процессора. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.03.2007, 13:36 |
|
||
|
|

start [/forum/topic.php?fid=57&tid=2029149]: |
0ms |
get settings: |
8ms |
get forum list: |
19ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
166ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
42ms |
get tp. blocked users: |
1ms |
| others: | 242ms |
| total: | 494ms |

| 0 / 0 |
