5.1.2 Memory Allocation Libraries

Since system memory is allocated in block units, libraries are provided for dividing up those blocks for use.

  • void* Vmalloc( size_t size )
  • void* Vcalloc( size_t nmemb, size_t size )
  • void* Vrealloc( void *ptr, size_t size )
  • void Vfree( void *ptr )
  • void* Kmalloc( size_t size )
  • void* Kcalloc( size_t nmemb, size_t size )
  • void* Krealloc( void *ptr, size_t size )
  • void Kfree( void *ptr )

The functions are equivalent to the standard C libraries malloc, calloc, realloc, free and so on. V. means the function is for nonresident memory and K. for resident memory; in both cases the memory is assigned to the TSVCLimit protection level. These functions cannot be called from a task-independent portion or while dispatching or interrupts are disabled. The behavior if they are called in those situations is undefined. (System failure is a possibility.)

Comments