Skip to content

morapi_Env Struct Reference

core » env

Environment.
More...

#include <morapi_core.h>

Public Member Functions

morapi_Env morapi_create_Env (void *io_heap_beg, morapi_Size i_heap_size)
morapi_Result  morapi_destroy_Env (morapi_Env *env)

Memory allocation

void *  morapi_Env_malloc (morapi_Env *self, morapi_Size i_size)
morapi_Result  morapi_Env_free (morapi_Env *self, void *io_ptr)
morapi_Size  morapi_Env_getMaxHeapSize (morapi_Env *self)

Logging

morapi_Result  morapi_Env_setLogFunc (morapi_Env *self, morapi_LogFunc i_log_func, void *i_log_obj)
morapi_Result  morapi_Env_setMsgFunc (morapi_Env *self, morapi_LogFunc i_msg_func, morapi_FlushFunc i_flush_func, void *i_msg_obj)
morapi_Result  morapi_Env_setLogLevel (morapi_Env *self, morapi_LogLevel i_level)
void  morapi_Env_logInfo (morapi_Env *self, const morapi_Char *i_module, const morapi_Char *i_fmt,...)


Detailed Description

Environment.


test_decompose_api.c, test_dnn_api.c, and test_prof_api.c.


Member Function Documentation


morapi_create_Env()

morapi_Env * morapi_create_Env (void * io_heap_beg,
                                morapi_Size i_heap_size)

Allocates and constructs an environment.

Parameters

  • io_heap_beg : begining of heap address.
  • i_heap_size : size of heap.

test_decompose_api.c, test_dnn_api.c, and test_prof_api.c.


morapi_destroy_Env()

morapi_Result morapi_destroy_Env (morapi_Env * env)

Destructs and deallocates an environment.


test_decompose_api.c, test_dnn_api.c, and test_prof_api.c.


morapi_Env_malloc()

void * morapi_Env_malloc (morapi_Env * self,
                          morapi_Size i_size)

Allocates heap memory.


morapi_Env_free()

morapi_Result morapi_Env_free (morapi_Env * self,
                               void * io_ptr)

Deallocates heap memory.


morapi_Env_getMaxHeapSize()

morapi_Size morapi_Env_getMaxHeapSize (morapi_Env * self)

Gets used heap size.


morapi_Env_setLogFunc()

morapi_Result morapi_Env_setLogFunc (morapi_Env * self,
                                     morapi_LogFunc i_log_func,
                                     void * i_log_obj)

Sets a log function.

A log is expected to output to stderr.


test_decompose_api.c, and test_prof_api.c.


morapi_Env_setMsgFunc()

morapi_Result morapi_Env_setMsgFunc (morapi_Env * self,
                                     morapi_LogFunc i_msg_func,
                                     morapi_FlushFunc i_flush_func,
                                     void * i_msg_obj)

Sets a message function.

A message is expected to output to stdout.


test_decompose_api.c, and test_prof_api.c.


morapi_Env_setLogLevel()

morapi_Result morapi_Env_setLogLevel (morapi_Env * self,
                                      morapi_LogLevel i_level)

Sets a log level.


morapi_Env_logInfo()

void morapi_Env_logInfo (morapi_Env * self,
                         const morapi_Char * i_module,
                         const morapi_Char * i_fmt,
                          ...)

Logs an infomation message.