freepooma-devel
[Top][All Lists]
Advanced

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

Patch: delete_test1.cpp


From: Jeffrey Oldham
Subject: Patch: delete_test1.cpp
Date: Fri, 25 May 2001 13:30:11 -0700
User-agent: Mutt/1.2.5i

Compiling src/Utilities/tests/delete_test1.cpp showed that the vector
type `Array_t' was declared to store doubles but actually stored
integers.  Also, a call to std::memmove() illegally converted vector
iterators to pointers.  The alternative call to std::copy() is instead
used.

Considerable discussion between Jim Crotinger and Jeffrey D. Oldham on
pooma-dev annoyed other people on the list.  The issue, also present
in some Domain code, is that using std::memmove() requires converting
a vector iterator to a pointer.  Jeffrey Oldham objects to this
violation of the abstraction barrier and was not able to show a
significant speedup using std::memmove() rather than std::copy().  Jim
Crotinger says he measured significant speed-up using std::memmove()
in early 2000.

For the record, one way to obtain a pointer to a vector location that
the gcc 3.0 compiler accepts is
  const Array_t::pointer data_begin_ptr = &(data[0]);

2001 May 25  Jeffrey D. Oldham  <address@hidden>

        * delete_test1.cpp (Array_t): s/vector<double>/vector<int>/
        (delete_shiftup_test2): Remove "optimization" call to memmove.

Tested on       sequential Linux using gcc 3.0 by compiling the program
Approved by     Jim Crotinger

Thanks,
Jeffrey D. Oldham
address@hidden

Attachment: delete_test1.cpp.patch.25May
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]