DL Logo

ASMem Functions

ASfree

Header: ASProcs.h:71

Description

Frees the specified memory block.

Related Methods

ASmalloc ASrealloc

Syntax

void ASfree(void *ptr);

Parameters

ptr
IN/OUT The block of memory to free.

ASfree

Header: ASProcs.h:115

Description

Frees the specified memory block.

Related Methods

ASmalloc ASrealloc

Syntax

void ASfree(void *ptr);

Parameters

ptr
IN/OUT The block of memory to free.

ASmalloc

Header: ASProcs.h:43

Description

Allocates and returns a pointer to a memory block containing the specified number of bytes.

Related Methods

ASfree ASrealloc

Syntax

void *ASmalloc(os_size_t nBytes);

Parameters

nBytes
IN/OUT The number of bytes for which space is allocated.

Returns

A pointer to the allocated memory. Returns NULL on failure.

ASmalloc

Header: ASProcs.h:86

Description

Allocates and returns a pointer to a memory block containing the specified number of bytes.

Related Methods

ASfree ASrealloc

Syntax

void *ASmalloc(os_size_t nBytes);

Parameters

nBytes
IN/OUT The number of bytes for which space is allocated.

Returns

A pointer to the allocated memory, NULL on failure.

ASrealloc

Header: ASProcs.h:61

Description

If possible, extends the given block and simply returns ptr. Otherwise, it allocates a new block of newNBytes bytes, copies the contents from the old pointer into the new block, frees the old pointer, and returns the pointer to the new block. If a new block cannot be allocated, the call fails and ptr is not freed. Reallocating a block to a smaller size will never fail.

Related Methods

ASfree ASmalloc

Syntax

void *ASrealloc(void *ptr, os_size_t newNBytes);

Parameters

ptr
IN/OUT The existing memory block.
newNBytes
IN/OUT The number of bytes the memory block must be able to hold.

Returns

A pointer to memory block.

ASrealloc

Header: ASProcs.h:105

Description

If possible, extends the given block and simply returns ptr. Otherwise, it allocates a new block of newNBytes bytes, copies the contents from the old pointer into the new block, frees the old pointer, and returns the pointer to the new block. If a new block cannot be allocated, the call fails and ptr is not freed. Reallocating a block to a smaller size will never fail.

Related Methods

ASfree ASmalloc

Syntax

void *ASrealloc(void *ptr, os_size_t newNBytes);

Parameters

ptr
IN/OUT The existing memory block.
newNBytes
IN/OUT The number of bytes the memory block must be able to hold.

Returns

A pointer to memory block.