00001
00002
00003
00004
00005
00006
00007 #ifndef EMEMOA_MEMPOOL_STRUCT_H__
00008 # define EMEMOA_MEMPOOL_STRUCT_H__
00009
00010 #include "config.h"
00011
00012 #include <stdint.h>
00013
00014 #ifdef HAVE_PTHREAD
00015 # include <pthread.h>
00016 #endif
00017
00018 #include "ememoa_mempool.h"
00019 #include "ememoa_mempool_error.h"
00020
00021
00022
00023
00024
00025
00026 struct ememoa_mempool_desc_s
00027 {
00028 const char *name;
00029 ememoa_fctl data_display;
00030 };
00031
00032 struct ememoa_mempool_fixed_s
00033 {
00034 #ifdef DEBUG
00035 unsigned int magic;
00036 #endif
00037
00038 ememoa_mempool_error_t last_error_code;
00039
00040 unsigned int object_size;
00041 unsigned int options;
00042
00043 unsigned int max_objects_pot;
00044 unsigned int max_objects_poi32;
00045 unsigned int max_objects;
00046
00047 unsigned int allocated_pool;
00048 unsigned int *available_objects;
00049 uint32_t* *objects_use;
00050 void* *objects_pool;
00051
00052 const struct ememoa_mempool_desc_s *desc;
00053
00054 #ifdef DEBUG
00055 unsigned int out_objects;
00056 unsigned int total_objects;
00057 unsigned int max_out_objects;
00058 #endif
00059
00060 #ifdef HAVE_PTHREAD
00061 pthread_mutex_t lock;
00062 #endif
00063 };
00064
00065 struct ememoa_mempool_alloc_item_s;
00066
00067 struct ememoa_mempool_unknown_size_s
00068 {
00069 #ifdef DEBUG
00070 unsigned int magic;
00071 #endif
00072
00073 ememoa_mempool_error_t last_error_code;
00074
00075 unsigned int options;
00076
00077 unsigned int pools_count;
00078 unsigned int *pools_match;
00079 struct ememoa_mempool_fixed_s *pools;
00080
00081 struct ememoa_mempool_fixed_s allocated_list;
00082
00083 struct ememoa_mempool_alloc_item_s *start;
00084
00085 const struct ememoa_mempool_desc_s *desc;
00086
00087 #ifdef HAVE_PTHREAD
00088 pthread_mutex_t lock;
00089 #endif
00090 };
00091
00092 #endif