| 12969 | void *BufferObject::sVTable = getVTable(); // Placing this here vs. in script_object.cpp improves some simple benchmarks by as much as 7%. |
| 12970 | |
| 12971 | void GetBufferObjectPtr(ResultToken &aResultToken, IObject *obj, size_t &aPtr, size_t &aSize) |
| 12972 | { |
| 12973 | if (BufferObject::IsInstanceExact(obj)) |
| 12974 | { |
| 12975 | // Some primitive benchmarks showed that this was about as fast as passing |
| 12976 | // a pointer directly, whereas invoking the properties (below) doubled the |
| 12977 | // overall time taken by NumGet/NumPut. |
| 12978 | aPtr = (size_t)((BufferObject *)obj)->Data(); |
| 12979 | aSize = ((BufferObject *)obj)->Size(); |
| 12980 | } |
| 12981 | else |
| 12982 | { |
| 12983 | if (GetObjectPtrProperty(obj, _T("Ptr"), aPtr, aResultToken)) |
| 12984 | GetObjectPtrProperty(obj, _T("Size"), aSize, aResultToken); |
| 12985 | } |
| 12986 | } |
| 12987 | |
| 12988 | void GetBufferObjectPtr(ResultToken &aResultToken, IObject *obj, size_t &aPtr) |
| 12989 | // See above for comments. |
no test coverage detected