Skip to content

Commit

Permalink
Remove unused qgsCalloc function
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 2, 2022
1 parent 1f1e616 commit 880c624
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion python/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ QString qgsVsiPrefix( const QString &path );




const long GEOSRID;

const long GEOCRS_ID;
Expand Down
15 changes: 0 additions & 15 deletions src/core/qgis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,6 @@ void *qgsMalloc( size_t size )
return p;
}

void *qgsCalloc( size_t nmemb, size_t size )
{
if ( nmemb == 0 || long( nmemb ) < 0 || size == 0 || long( size ) < 0 )
{
QgsDebugMsg( QStringLiteral( "Negative or zero nmemb %1 or size %2." ).arg( nmemb ).arg( size ) );
return nullptr;
}
void *p = qgsMalloc( nmemb * size );
if ( p )
{
memset( p, 0, nmemb * size );
}
return p;
}

void qgsFree( void *ptr )
{
free( ptr );
Expand Down
9 changes: 0 additions & 9 deletions src/core/qgis.h
Original file line number Diff line number Diff line change
Expand Up @@ -1578,15 +1578,6 @@ CORE_EXPORT QString qgsVsiPrefix( const QString &path );
*/
void CORE_EXPORT *qgsMalloc( size_t size ) SIP_SKIP;

/**
* Allocates memory for an array of nmemb elements of size bytes each and returns
* a pointer to the allocated memory. Works like C calloc() but prints debug message
* by QgsLogger if allocation fails.
* \param nmemb number of elements
* \param size size of element in bytes
*/
void CORE_EXPORT *qgsCalloc( size_t nmemb, size_t size ) SIP_SKIP;

/**
* Frees the memory space pointed to by ptr. Works like C free().
* \param ptr pointer to memory space
Expand Down

0 comments on commit 880c624

Please sign in to comment.