grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

alloc.c File Reference

DBMI Library (base) - allocate memory. More...

#include <string.h>
#include <stdlib.h>
#include <grass/dbmi.h>
Include dependency graph for alloc.c:

Go to the source code of this file.

Functions

char * db_store (const char *s)
 Make a copy of string buffer. More...
 
void * db_malloc (int n)
 Allocate memory. More...
 
void * db_calloc (int n, int m)
 Allocate memory. More...
 
void * db_realloc (void *s, int n)
 Reallocate memory. More...
 
void db_free (void *s)
 Free allocated memory. More...
 

Detailed Description

DBMI Library (base) - allocate memory.

(C) 1999-2009, 2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Joel Jones (CERL/UIUC), Radim Blazek
Doxygenized by Martin Landa <landa.martin gmail.com> (2011)

Definition in file alloc.c.

Function Documentation

◆ db_calloc()

void * db_calloc ( int  n,
int  m 
)

Allocate memory.

On failure is called db_memory_error().

Parameters
nnumber of entities
mentity size
Returns
pointer to allocated memmory

Definition at line 69 of file alloc.c.

References db_memory_error(), NULL, and s.

Referenced by db__recv_double_array(), db__recv_float_array(), db__recv_int_array(), db__recv_short_array(), db_alloc_cursor_column_flags(), db_alloc_dirent_array(), db_alloc_handle_array(), db_alloc_index_array(), db_alloc_string_array(), db_alloc_table(), and db_copy_column().

◆ db_free()

◆ db_malloc()

void * db_malloc ( int  n)

Allocate memory.

On failure is called db_memory_error().

Parameters
nnumber of bytes to be allocated
Returns
pointer to allocated memory

Definition at line 47 of file alloc.c.

References db_memory_error(), NULL, and s.

Referenced by add_entry(), db_alloc_table(), db_d_open_insert_cursor(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_dirent(), db_start_driver(), db_store(), and login_filename().

◆ db_realloc()

void * db_realloc ( void *  s,
int  n 
)

Reallocate memory.

On failure is called db_memory_error().

Parameters
spointer to memory
nnumber of newly allocated bytes
Returns
pointer to allocated memmory

Definition at line 93 of file alloc.c.

References db_memory_error(), NULL, and s.

Referenced by db__add_cursor_to_driver_state(), db_append_table_column(), db_enlarge_string(), and db_new_token().

◆ db_store()

char * db_store ( const char *  s)

Make a copy of string buffer.

Allocated string buffer should be freed by db_free().

Parameters
ssource string buffer
Returns
allocated string buffer

Definition at line 28 of file alloc.c.

References a, db_malloc(), and s.

Referenced by db__mark_database_open(), db_error(), and db_set_error_who().