GMP Native Interface for .NET
gmp_libreallocate Method |
Resize a previously allocated block ptr of old_size bytes to be new_size bytes.
Namespace: Math.Gmp.Native
Assembly: Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)

public static void_ptr reallocate( void_ptr ptr, size_t old_size, size_t new_size )
Public Shared Function reallocate ( ptr As void_ptr, old_size As size_t, new_size As size_t ) As void_ptr
public: static void_ptr reallocate( void_ptr ptr, size_t old_size, size_t new_size )
static member reallocate : ptr : void_ptr * old_size : size_t * new_size : size_t -> void_ptr
Parameters
- ptr
- Type: Math.Gmp.Nativevoid_ptr
Pointer to previously allocated block. - old_size
- Type: Math.Gmp.Nativesize_t
Number of bytes of previously allocated block. - new_size
- Type: Math.Gmp.Nativesize_t
New number of bytes of previously allocated block.
Return Value
Type: void_ptrA previously allocated block ptr of old_size bytes to be new_size bytes.

The block may be moved if necessary or if desired, and in that case the smaller of old_size and new_size bytes must be copied to the new location. The return value is a pointer to the resized block, that being the new location if moved or just ptr if not.
ptr is never NULL, it’s always a previously allocated block. new_size may be bigger or smaller than old_size.
The reallocate function parameter old_size is passed for convenience, but of course it can be ignored if not needed by an implementation. The default functions using malloc and friends for instance don’t use it.
