glowmem.h File Reference

API published in:
API deprecated in:


#include <unistd.h>
#include <setjmp.h>

Go to the source code of this file.


Data Structures

struct   _cleanUpStack
struct   _mem_info

Defines

#define  SET_LOW_MEMORY_TRAP_VOID()
#define  SET_LOW_MEMORY_TRAP(failure_value)
#define  REMOVE_LOW_MEMORY_TRAP()

Typedefs

typedef _cleanUpStack  cleanUpStack
typedef _mem_info  mem_info

Functions

IMPORT_C mem_info _get_thread_specific_data ()
IMPORT_C int  _set_thread_specific_data (mem_info *m)
IMPORT_C int  _push (cleanUpStack *cs, void *ptr)
IMPORT_C void *  _pop (cleanUpStack *cs)
IMPORT_C void  _findAndDestroy (cleanUpStack *cs, void *ptr)
IMPORT_C void  _destroCleanUpStack (cleanUpStack *cs)
IMPORT_C void  _clearCleanUpStack (cleanUpStack *cs)
IMPORT_C void *  _pAlloc (size_t size)
IMPORT_C void  _dummy1 ()
IMPORT_C void  _dummy2 ()
IMPORT_C void  _dummy3 ()

Define Documentation

#define REMOVE_LOW_MEMORY_TRAP
 
 ) 
 

Value:

{\
if(did_i_set)\
        {\
        mem_info *m = _get_thread_specific_data();\
        if(m)\
                m->is_setjmp_called = FALSE;\
                _clearCleanUpStack(&(m->stack));\
        }\
}
#define SET_LOW_MEMORY_TRAP failure_value   ) 
 

Value:

gboolean did_i_set = FALSE;\
{\
        mem_info *m = _get_thread_specific_data();\
        if(m == NULL)\
        {\
                m = (mem_info *)_pAlloc(sizeof(mem_info));\
                if(!m)\
                        return failure_value;\
                m->is_setjmp_called = FALSE;\
                _clearCleanUpStack(&(m->stack));\
                if(_set_thread_specific_data(m))\
                        return failure_value;\
        }\
        if(!m->is_setjmp_called)\
        {\
                if(setjmp(m->buf) > 0)\
                {\
                        m->is_setjmp_called = FALSE;\
                        _destroCleanUpStack(&(m->stack));\
                        return failure_value;\
                }\
                m->is_setjmp_called = TRUE;\
                did_i_set = TRUE;\
        }\
}
#define SET_LOW_MEMORY_TRAP_VOID
 
 ) 
 

Value:

gboolean did_i_set = FALSE;\
{\
        mem_info *m = _get_thread_specific_data();\
        if(m == NULL)\
        {\
                m = (mem_info *)_pAlloc(sizeof(mem_info));\
                if(!m)\
                        return;\
                m->is_setjmp_called = FALSE;\
                _clearCleanUpStack(&(m->stack));\
                if(_set_thread_specific_data(m))\
                        return;\
        }\
        if(!m->is_setjmp_called)\
        {\
                if(setjmp(m->buf) > 0)\
                {\
                        m->is_setjmp_called = FALSE;\
                        _destroCleanUpStack(&(m->stack));\
                        return ;\
                }\
                m->is_setjmp_called = TRUE;\
                did_i_set = TRUE;\
        }\
}

Typedef Documentation

typedef struct _cleanUpStack cleanUpStack
 
typedef struct _mem_info mem_info
 

Function Documentation

IMPORT_C void _clearCleanUpStack cleanUpStack cs  ) 
 
IMPORT_C void _destroCleanUpStack cleanUpStack cs  ) 
 
IMPORT_C void _dummy1  ) 
 
IMPORT_C void _dummy2  ) 
 
IMPORT_C void _dummy3  ) 
 
IMPORT_C void _findAndDestroy cleanUpStack cs,
void *  ptr
 
IMPORT_C mem_info* _get_thread_specific_data  ) 
 
IMPORT_C void* _pAlloc size_t  size  ) 
 
IMPORT_C void* _pop cleanUpStack cs  ) 
 
IMPORT_C int _push cleanUpStack cs,
void *  ptr
 
IMPORT_C int _set_thread_specific_data mem_info m  ) 
 

Copyright © Nokia Corporation 2001-2008
Back to top