Changeset 381


Ignore:
Timestamp:
2007-05-10T03:26:12+02:00 (7 years ago)
Author:
moo
Message:

merged [380] from 1.2: make life easier for debugging

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/mem.c

    r306 r381  
    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" 
     
    3131 
    3232/* {{{ mem */ 
    33 struct _xc_block_t { 
     33struct _xc_mem_block_t { 
    3434#ifdef ALLOC_DEBUG_BLOCK_CHECK 
    3535    unsigned int magic; 
     
    3939}; 
    4040 
    41 struct _xc_mem_t { 
     41struct _xc_mem_mem_t { 
    4242    const xc_mem_handlers_t *handlers; 
    4343    xc_shm_t                *shm; 
  • trunk/mem.h

    r148 r381  
    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); 
  • trunk/mmap.c

    r337 r381  
    3030 
    3131#include "php.h" 
    32 #define XC_SHM_IMPL 
     32#define XC_SHM_IMPL _xc_mmap_shm_t 
    3333#include "xc_shm.h" 
    3434#include "utils.h" 
     
    3939 
    4040/* {{{ xc_shm_t */ 
    41 struct _xc_shm_t { 
     41struct _xc_mmap_shm_t { 
    4242    xc_shm_handlers_t *handlers; 
    4343    void *ptr; 
  • trunk/xc_malloc.c

    r305 r381  
    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> 
     
    99#include "utils.h" 
    1010 
    11 struct _xc_mem_t { 
     11struct _xc_malloc_mem_t { 
    1212    const xc_mem_handlers_t *handlers; 
    1313    xc_shm_t                *shm; 
     
    107107/* }}} */ 
    108108 
    109 /* {{{ xc_shm_t */ 
    110 struct _xc_shm_t { 
     109/* {{{ _xc_malloc_shm_t */ 
     110struct _xc_malloc_shm_t { 
    111111    xc_shm_handlers_t *handlers; 
    112112    xc_shmsize_t       size; 
  • trunk/xc_shm.h

    r305 r381  
    11#ifndef XC_SHM_H 
    22#define XC_SHM_H 
    3 typedef struct _xc_shm_t xc_shm_t; 
     3typedef struct _xc_shm_handlers_t xc_shm_handlers_t; 
     4 
     5#ifndef XC_SHM_IMPL 
     6struct _xc_shm_t { 
     7    const xc_shm_handlers_t *handlers; 
     8}; 
     9#define XC_SHM_IMPL _xc_shm_t 
     10#endif 
     11 
     12typedef struct XC_SHM_IMPL xc_shm_t; 
    413typedef size_t xc_shmsize_t; 
    514 
     
    3443} 
    3544 
    36 typedef struct { 
     45struct _xc_shm_handlers_t { 
    3746    const xc_mem_handlers_t *memhandlers; 
    3847    XC_SHM_CAN_READONLY((*can_readonly)); 
     
    4655    XC_SHM_MEMINIT((*meminit)); 
    4756    XC_SHM_MEMDESTROY((*memdestroy)); 
    48 } xc_shm_handlers_t; 
     57}; 
    4958 
    50  
    51 #ifndef XC_SHM_IMPL 
    52 struct _xc_shm_t { 
    53     const xc_shm_handlers_t *handlers; 
    54 }; 
    55 #endif 
    5659typedef struct _xc_shm_scheme_t xc_shm_scheme_t; 
    5760 
Note: See TracChangeset for help on using the changeset viewer.