N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

malloc_memcheck

Format
#include <malloc.h>
int malloc_memcheck(struct malloc_status_st *st)


Arguments
  • st is the pointer to the malloc_status_st structure that returns information on the memory allocation area
Return Value
0 is returned if the function execution was normal. In case of any value other than 0, the contents of the malloc_status_st structure are suspect and probably incorrect. For example, if 0 is returned, the size of the entire memory allocation area is recorded in the specified malloc_status_st structure. However, if the size of the entire memory allocation area is reported as 0 in the malloc_status_st structure, then the malloc_status_st contents are incorrect, so the function returns -1 instead of 0.

What This Function Does
It checks the memory allocation area to see if its condition is normal or abnormal, and acquires information on the used and unused portions of the memory allocation area.

Following are the elements of the malloc_status_st structure:
struct   malloc_status_st   {
int   alMemsize;      /* size of entire memory area */

int   useMemsize;     /* memory size used */
int   useMaxMemSize   /* maximum memory size used */
int   useMinMemSize   /* minimum memory size used */

int   freeMemSize;    /* free memory size */
int   freeMaxMemSize; /* minimum free memory size */
int   freeMinMemSize  /* maximum free memory size */
};
Note
This standard function comes with NuSystem.


Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998