A pointer to the base of a valid memory block or to null.
The desired allocation size in bytes.
A bitmask of the BlkAttr attributes to set on this block.
TypeInfo to describe the memory. The GC might use this information to improve scanning for pointers or to call finalizers.
A reference to the allocated memory on success or null if sz is zero or the pointer does not point to the base of an GC allocated memory block.
OutOfMemoryError on allocation failure.
Extend, shrink or allocate a new block of memory keeping the contents of an existing block
If sz is zero, the memory referenced by p will be deallocated as if by a call to free. If p is null, new memory will be allocated via malloc. If p is pointing to memory not allocated from the GC or to the interior of an allocated memory block, no operation is performed and null is returned.
Otherwise, a new memory block of size sz will be allocated as if by a call to malloc, or the implementation may instead resize or shrink the memory block in place. The contents of the new memory block will be the same as the contents of the old memory block, up to the lesser of the new and old sizes.
The caller guarantees that there are no other live pointers to the passed memory block, still it might not be freed immediately by realloc. The garbage collector can reclaim the memory block in a later collection if it is unused. If allocation fails, this function will throw an OutOfMemoryError.
If ba is zero (the default) the attributes of the existing memory will be used for an allocation. If ba is not zero and no new memory is allocated, the bits in ba will replace those of the current memory block.