/** \brief returns size in bytes of memory for NMEM handle
\returns number of bytes
*/
-YAZ_EXPORT int nmem_total(NMEM n);
+YAZ_EXPORT size_t nmem_total(NMEM n);
/** \brief allocates string on NMEM handle (similar strdup)
\param mem HNEM handle
\param size number of bytes to be allocated
\returns pointer to allocated memory
*/
-YAZ_EXPORT void *nmem_malloc(NMEM n, int size);
+YAZ_EXPORT void *nmem_malloc(NMEM n, size_t size);
YAZ_END_CDECL
* This is a simple and fairly wasteful little module for nibble memory
* allocation. Evemtually we'll put in something better.
*
- * FIXME - it also has some semaphore stuff, and stuff to handle errno.
- * These should be moved to some other place!
*/
#if HAVE_CONFIG_H
#include <config.h>
struct nmem_control
{
- int total;
+ size_t total;
struct nmem_block *blocks;
struct nmem_control *next;
};
n->total = 0;
}
-void *nmem_malloc(NMEM n, int size)
+void *nmem_malloc(NMEM n, size_t size)
{
struct nmem_block *p;
char *r;
return r;
}
-int nmem_total(NMEM n)
+size_t nmem_total(NMEM n)
{
return n->total;
}