#ifdef __cplusplus
}
#endif
#endif
2. mm.c
/** Libmm replacement used by cache design of FTPHP-searchd Some source codes cut from eAccelerator/PHP $Id: mm.c,v 1.3 2009/05/12 16:01:25 hightman Exp $ */ #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/sem.h> #include <sys/mman.h> #include <errno.h> typedef struct mm_mutex { int semid; } mm_mutex; typedef struct mm_free_bucket { size_t size; struct mm_free_bucket *next; } mm_free_bucket; typedef struct mm_core { size_t size; void *start; size_t available; mm_mutex *lock; mm_free_bucket *free_list; } mm_core; typedef union mm_mem_head { size_t size; double a1; int (*a2)(int); void *a3; } mm_mem_head; #define MM_SIZE(sz) (sizeof(mm_mem_head)+(sz))
时间:2009-06-13 20:29
来源:chinaunix
作者:hightman
原文链接
好文,顶一下
(1)
50%
文章真差,踩一下
(1)
50%
------分隔线----------------------------
把开源带在你的身边-精美linux小纪念品
|