Changeset 380 for branches/1.2
- Timestamp:
- 05/10/2007 01:20:46 AM (19 months ago)
- Location:
- branches/1.2
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/mem.c
r302 r380 9 9 #include <stdlib.h> 10 10 #include <string.h> 11 #define XC_ SHM_IMPL12 #define XC_MEM_IMPL 11 #define XC_MEMBLOCK_IMPL _xc_mem_block_t 12 #define XC_MEM_IMPL _xc_mem_mem_t 13 13 #include "xc_shm.h" 14 14 #include "align.h" … … 30 30 31 31 /* {{{ mem */ 32 struct _xc_ block_t {32 struct _xc_mem_block_t { 33 33 #ifdef ALLOC_DEBUG_BLOCK_CHECK 34 34 unsigned int magic; … … 38 38 }; 39 39 40 struct _xc_mem_ t {40 struct _xc_mem_mem_t { 41 41 const xc_mem_handlers_t *handlers; 42 42 xc_shm_t *shm; -
branches/1.2/mem.h
r148 r380 1 typedef struct _xc_mem_t xc_mem_t; 2 typedef struct _xc_block_t xc_block_t; 1 typedef struct _xc_mem_handlers_t xc_mem_handlers_t; 2 3 #ifndef XC_MEM_IMPL 4 struct _xc_mem_t { 5 const xc_mem_handlers_t *handlers; 6 xc_shm_t *shm; 7 }; 8 # define XC_MEM_IMPL _xc_mem_t 9 #endif 10 11 #ifndef XC_MEMBLOCK_IMPL 12 # define XC_MEMBLOCK_IMPL _xc_block_t 13 #endif 14 typedef struct XC_MEM_IMPL xc_mem_t; 15 typedef struct XC_MEMBLOCK_IMPL xc_block_t; 3 16 typedef unsigned int xc_memsize_t; 4 17 … … 38 51 } 39 52 40 typedef struct {53 struct _xc_mem_handlers_t { 41 54 XC_MEM_MALLOC((*malloc)); 42 55 XC_MEM_FREE((*free)); … … 54 67 XC_MEM_INIT((*init)); 55 68 XC_MEM_DESTROY((*destroy)); 56 } xc_mem_handlers_t;57 58 #ifndef XC_MEM_IMPL59 struct _xc_mem_t {60 const xc_mem_handlers_t *handlers;61 xc_shm_t *shm;62 69 }; 63 #endif64 70 65 71 int xc_mem_scheme_register(const char *name, const xc_mem_handlers_t *handlers); -
branches/1.2/mmap.c
r334 r380 32 32 33 33 #include "php.h" 34 #define XC_SHM_IMPL 34 #define XC_SHM_IMPL _xc_mmap_shm_t 35 35 #include "xc_shm.h" 36 36 … … 40 40 41 41 /* {{{ xc_shm_t */ 42 struct _xc_ shm_t {42 struct _xc_mmap_shm_t { 43 43 xc_shm_handlers_t *handlers; 44 44 void *ptr; -
branches/1.2/xc_malloc.c
r302 r380 1 #define XC_SHM_IMPL 2 #define XC_MEM_IMPL 1 #define XC_SHM_IMPL _xc_malloc_shm_t 2 #define XC_MEM_IMPL _xc_malloc_mem_t 3 3 #include <stdlib.h> 4 4 #include <stdio.h> … … 8 8 #include "align.h" 9 9 10 struct _xc_m em_t {10 struct _xc_malloc_mem_t { 11 11 const xc_mem_handlers_t *handlers; 12 12 xc_shm_t *shm; … … 106 106 /* }}} */ 107 107 108 /* {{{ xc_shm_t */109 struct _xc_ shm_t {108 /* {{{ _xc_malloc_shm_t */ 109 struct _xc_malloc_shm_t { 110 110 xc_shm_handlers_t *handlers; 111 111 xc_shmsize_t size; -
branches/1.2/xc_shm.h
r163 r380 1 typedef struct _xc_shm_t xc_shm_t; 1 typedef struct _xc_shm_handlers_t xc_shm_handlers_t; 2 3 #ifndef XC_SHM_IMPL 4 struct _xc_shm_t { 5 const xc_shm_handlers_t *handlers; 6 }; 7 #define XC_SHM_IMPL _xc_shm_t 8 #endif 9 10 typedef struct XC_SHM_IMPL xc_shm_t; 2 11 typedef size_t xc_shmsize_t; 3 12 … … 32 41 } 33 42 34 typedef struct {43 struct _xc_shm_handlers_t { 35 44 const xc_mem_handlers_t *memhandlers; 36 45 XC_SHM_CAN_READONLY((*can_readonly)); … … 44 53 XC_SHM_MEMINIT((*meminit)); 45 54 XC_SHM_MEMDESTROY((*memdestroy)); 46 } xc_shm_handlers_t;55 }; 47 56 48 49 #ifndef XC_SHM_IMPL50 struct _xc_shm_t {51 const xc_shm_handlers_t *handlers;52 };53 #endif54 57 typedef struct _xc_shm_scheme_t xc_shm_scheme_t; 55 58

