T.R | Title | User | Personal Name | Date | Lines |
---|
1005.1 | Watch out for memcpy on ULTRIX | HANNAH::MESSENGER | Bob Messenger | Thu Jun 22 1989 17:05 | 18 |
| Re: .0
Related problem (I'm ashamed to admit this since Vince will read this!):
don't convert the bcopy's to memcpy's, because on ULTRIX memcpy *doesn't*
check for overlapping sources and destinations. I changed DECterm's bcopy's to
memcpy's so I could link with just the standard VAXCRTL on VMS, but later on it
broke when I tried to run it on ULTRIX. My latest solution is:
#ifdef VMS
#define COPY( d, s, n ) memcpy( d, s, n )
#else
#define COPY( d, s, n ) bcopy( s, d, n )
#endif
(Note that the first two operations are reversed between memcpy and bcopy.)
-- Bob
|
1005.2 | No problem | TLE::DANIELS | Brad Daniels, VAX C RTL whipping boy | Fri Jun 23 1989 17:17 | 7 |
| Actually, this is not a failing in Ultrix. The problem is that memcpy() on
VMS is an over-achiever. According to ANSI, only memmove() needs to check
for overlap (it is equivalent to bcopy()). The memcpy() function doesn't
have to check for overlap, meanin it can be faster on many architectures.
- Brad
|
1005.3 | | KONING::KONING | NI1D @FN42eq | Tue Jun 27 1989 15:47 | 7 |
| ...but of course on VAXen the string move instruction does the overlap
check itself, so there doesn't seem to be any rational reason for any
data move routine to work any other way unless it is REQUIRED to work
that way.
paul
|
1005.4 | | TLE::DANIELS | Brad Daniels, VAX C RTL whipping boy | Tue Jun 27 1989 16:22 | 4 |
| ... Unless it has to deal with more than 65535 characters...
- Brad
|
1005.5 | Could use the RTL | QUARK::LIONEL | B - L - Oh, I don't know! | Tue Jun 27 1989 16:59 | 5 |
| OTS$MOVE3 and OTS$MOVE5 were written for VMS for just this purpose. They will
do moves of up to 2**30 characters and handle overlaps properly.
Steve
|
1005.6 | Re .-1: | TLE::DANIELS | Brad Daniels, VAX C RTL whipping boy | Tue Jun 27 1989 18:31 | 2 |
| What do you think memmove() does? 8*}
|