diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-02-07 20:46:34 +0100 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-07 15:08:54 -0800 |
| commit | a5fc0b08de94fc2ca061968c6ae7f69aef55705f (patch) | |
| tree | 23b25464b9112d8963d3fa73354bdf4e9dd02425 /src | |
| parent | 3e9859362b1344add0e0443e88ae3e2f17a5a865 (diff) | |
| download | rust-a5fc0b08de94fc2ca061968c6ae7f69aef55705f.tar.gz rust-a5fc0b08de94fc2ca061968c6ae7f69aef55705f.zip | |
added some documentation and made the memcpy and memmove unsafe
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/ptr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index e844dcda36a..6e946cd3289 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -57,15 +57,17 @@ fn null<T>() -> *T unsafe { ret unsafe::reinterpret_cast(0u); } Function: memcpy Copies data from one src to dst that is not overlapping each other. +Count is the number of elements to copy and not the number of bytes. */ -fn memcpy<T>(dst: *T, src: *T, count: uint) unsafe { rusti::memcpy(dst, src, count); } +unsafe fn memcpy<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); } /* Function: memmove Copies data from one src to dst, overlap between the two pointers may occur. +Count is the number of elements to copy and not the number of bytes. */ -fn memmove<T>(dst: *T, src: *T, count: uint) unsafe { rusti::memcpy(dst, src, count); } +unsafe fn memmove<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); } #[test] fn test() unsafe { |
