Changeset 380 in svn


Ignore:
Timestamp:
2007-05-10T01:20:46Z (8 years ago)
Author:
Xuefer
Message:

make life easier for debugging

Location:
branches/1.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/mem.c

    r302 r380  
    99#include <stdlib.h>
    1010#include <string.h>
    11 #define XC_SHM_IMPL
    12 #define XC_MEM_IMPL
     11#define XC_MEMBLOCK_IMPL _xc_mem_block_t
     12#define XC_MEM_IMPL _xc_mem_mem_t
    1313#include "xc_shm.h"
    1414#include "align.h"
     
    3030
    3131/* {{{ mem */
    32 struct _xc_block_t {
     32struct _xc_mem_block_t {
    3333#ifdef ALLOC_DEBUG_BLOCK_CHECK
    3434    unsigned int magic;
     
    3838};
    3939
    40 struct _xc_mem_t {
     40struct _xc_mem_mem_t {
    4141    const xc_mem_handlers_t *handlers;
    4242    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;
     1typedef struct _xc_mem_handlers_t xc_mem_handlers_t;
     2
     3#ifndef XC_MEM_IMPL
     4struct _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
     14typedef struct XC_MEM_IMPL xc_mem_t;
     15typedef struct XC_MEMBLOCK_IMPL xc_block_t;
    316typedef unsigned int xc_memsize_t;
    417
     
    3851}
    3952
    40 typedef struct {
     53struct _xc_mem_handlers_t {
    4154    XC_MEM_MALLOC((*malloc));
    4255    XC_MEM_FREE((*free));
     
    5467    XC_MEM_INIT((*init));
    5568    XC_MEM_DESTROY((*destroy));
    56 } xc_mem_handlers_t;
    57 
    58 #ifndef XC_MEM_IMPL
    59 struct _xc_mem_t {
    60     const xc_mem_handlers_t *handlers;
    61     xc_shm_t                *shm;
    6269};
    63 #endif
    6470
    6571int xc_mem_scheme_register(const char *name, const xc_mem_handlers_t *handlers);
  • branches/1.2/mmap.c

    r334 r380  
    3232
    3333#include "php.h"
    34 #define XC_SHM_IMPL
     34#define XC_SHM_IMPL _xc_mmap_shm_t
    3535#include "xc_shm.h"
    3636
     
    4040
    4141/* {{{ xc_shm_t */
    42 struct _xc_shm_t {
     42struct _xc_mmap_shm_t {
    4343    xc_shm_handlers_t *handlers;
    4444    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
    33#include <stdlib.h>
    44#include <stdio.h>
     
    88#include "align.h"
    99
    10 struct _xc_mem_t {
     10struct _xc_malloc_mem_t {
    1111    const xc_mem_handlers_t *handlers;
    1212    xc_shm_t                *shm;
     
    106106/* }}} */
    107107
    108 /* {{{ xc_shm_t */
    109 struct _xc_shm_t {
     108/* {{{ _xc_malloc_shm_t */
     109struct _xc_malloc_shm_t {
    110110    xc_shm_handlers_t *handlers;
    111111    xc_shmsize_t       size;
  • branches/1.2/xc_shm.h

    r163 r380  
    1 typedef struct _xc_shm_t xc_shm_t;
     1typedef struct _xc_shm_handlers_t xc_shm_handlers_t;
     2
     3#ifndef XC_SHM_IMPL
     4struct _xc_shm_t {
     5    const xc_shm_handlers_t *handlers;
     6};
     7#define XC_SHM_IMPL _xc_shm_t
     8#endif
     9
     10typedef struct XC_SHM_IMPL xc_shm_t;
    211typedef size_t xc_shmsize_t;
    312
     
    3241}
    3342
    34 typedef struct {
     43struct _xc_shm_handlers_t {
    3544    const xc_mem_handlers_t *memhandlers;
    3645    XC_SHM_CAN_READONLY((*can_readonly));
     
    4453    XC_SHM_MEMINIT((*meminit));
    4554    XC_SHM_MEMDESTROY((*memdestroy));
    46 } xc_shm_handlers_t;
     55};
    4756
    48 
    49 #ifndef XC_SHM_IMPL
    50 struct _xc_shm_t {
    51     const xc_shm_handlers_t *handlers;
    52 };
    53 #endif
    5457typedef struct _xc_shm_scheme_t xc_shm_scheme_t;
    5558
Note: See TracChangeset for help on using the changeset viewer.