My Project
programmer's documentation
Functions
bft_mem_usage.c File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem_usage.h"
Include dependency graph for bft_mem_usage.c:

Functions

void bft_mem_usage_init (void)
 Initialize memory usage count depending on system. More...
 
void bft_mem_usage_end (void)
 End memory usage count depending on system. More...
 
int bft_mem_usage_initialized (void)
 Indicates if bft_mem_usage_...() functions are initialized. More...
 
size_t bft_mem_usage_pr_size (void)
 Return current process memory use (in kB) depending on system. More...
 
size_t bft_mem_usage_max_pr_size (void)
 
void bft_mem_usage_n_calls (size_t count[3])
 

Detailed Description

Base memory usage information (System and Library dependent).

The memory-usage measurement functions provided here may be system-dependent. If they have not yet been ported to a given type of environment, these functions should return 0.

The user should thus check for the return values of such functions to avoid reporting invalid values, but the API is guaranteed.

Function Documentation

◆ bft_mem_usage_end()

void bft_mem_usage_end ( void  )

End memory usage count depending on system.

◆ bft_mem_usage_init()

void bft_mem_usage_init ( void  )

Initialize memory usage count depending on system.

This functions checks if it has already been called, so it is safe to call more than once (though it is not thread-safe). Only the first call is effective.

◆ bft_mem_usage_initialized()

int bft_mem_usage_initialized ( void  )

Indicates if bft_mem_usage_...() functions are initialized.

Returns
1 if bft_mem_usage_init has been called, 0 otherwise.

◆ bft_mem_usage_max_pr_size()

size_t bft_mem_usage_max_pr_size ( void  )

◆ bft_mem_usage_n_calls()

void bft_mem_usage_n_calls ( size_t  count[3])

◆ bft_mem_usage_pr_size()

size_t bft_mem_usage_pr_size ( void  )

Return current process memory use (in kB) depending on system.

If the information is not available (depending on availability of non-portable function calls), 0 is returned.