SoCpuBufferObjectSetSize Method |
Sets the size in bytes of the buffer object.
Namespace: OIV.Inventor.Devices
The size in bytes of the memory to allocate.
True if allocation succeeded.
In other words, a request to allocate size bytes of CPU memory. Returns true if the allocation succeeded. The memory is owned by the buffer object and will be freed when the buffer object is destroyed.
If the requested size is the same as the current size, this method does nothing and returns true. If there is existing memory that is owned by the buffer object, that memory is released. If the requested size is zero, the buffer object is now empty. By default memory allocations have the maximum possible alignment to allow use with (for example) SSE instructions.
By default memory is managed using the new/delete operators. On Microsoft Windows platforms it is possible to use VirtualAlloc/VirtualFree instead by setting OIV_BUFFER_USE_VIRTUAL_ALLOC (see SoPreferences).