Changeset 76

Show
Ignore:
Timestamp:
05/06/05 17:05:15 (4 years ago)
Author:
zoeloelip
Message:

Patch fixing eLoader. eLoader makes php5 segfault, on execution

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/eaccelerator.h

    r73 r76  
    3636#include "zend_API.h" 
    3737#include "zend_extensions.h" 
    38 #include "mm.h" 
    3938 
    4039/* Handle __attribute__ for nongcc compilers */ 
     
    5352#endif 
    5453 
    55 /* needed to compile eA as a static php module */ 
    56 extern zend_module_entry eaccelerator_module_entry; 
    57 #define phpext_eaccelerator_ptr &eaccelerator_module_entry 
    58  
    5954/* fixes compile errors on php5.1 */ 
    6055#ifdef STR_EMPTY_ALLOC 
     
    8782 
    8883#ifdef HAVE_EACCELERATOR 
     84#ifndef HAVE_EACCELERATOR_STANDALONE_LOADER  
     85 
     86#include "mm.h" 
    8987 
    9088#ifdef EACCELERATOR_WITHOUT_FILE_LOCKING 
     
    193191#endif 
    194192 
    195 #define EACCELERATOR_EXTENSION_NAME "eAccelerator" 
    196 #define EACCELERATOR_LOADER_EXTENSION_NAME "eLoader" 
    197  
    198 #define MMC_ENCODER_VERSION   0x00000003 
    199 #define MMC_ENCODER_END       0x00 
    200 #define MMC_ENCODER_NAMESPACE 0x01 
    201 #define MMC_ENCODER_CLASS     0x02 
    202 #define MMC_ENCODER_FUNCTION  0x03 
    203  
    204 #define EACCELERATOR_VERSION_GUID   "PHPE8EDA1B6-806A-4851-B1C8-A6B4712F44FB" 
    205 #define EACCELERATOR_LOGO_GUID      "PHPE6F78DE9-13E4-4dee-8518-5FA2DACEA803" 
    206 #define EACCELERATOR_VERSION_STRING ("eAccelerator " EACCELERATOR_VERSION " (PHP " PHP_VERSION ")") 
    207  
    208 #ifdef ZTS 
    209 #  define MMCG(v) TSRMG(eaccelerator_globals_id, zend_eaccelerator_globals*, v) 
    210 #else 
    211 #  define MMCG(v) (eaccelerator_globals.v) 
    212 #endif 
    213  
    214193/******************************************************************************/ 
    215194 
     
    394373} eaccelerator_cache_place; 
    395374 
     375typedef union align_union { 
     376  double d; 
     377  void *v; 
     378  int (*func)(int); 
     379  long l; 
     380} align_union; 
     381 
     382/******************************************************************************/ 
     383 
     384#ifdef ZTS 
     385MUTEX_T mm_mutex; 
     386#endif 
     387 
     388/* needed to compile eA as a static php module */ 
     389extern zend_module_entry eaccelerator_module_entry; 
     390#define phpext_eaccelerator_ptr &eaccelerator_module_entry 
     391 
     392 
     393void format_size (char *s, unsigned int size, int legend); 
     394void eaccelerator_prune (time_t t); 
     395 
     396int eaccelerator_lock (const char *key, int key_len TSRMLS_DC); 
     397int eaccelerator_unlock (const char *key, int key_len TSRMLS_DC); 
     398 
     399void *eaccelerator_malloc2 (size_t size TSRMLS_DC); 
     400 
     401unsigned int eaccelerator_crc32 (const char *p, size_t n); 
     402int eaccelerator_md5 (char *s, const char *prefix, const char *key TSRMLS_DC); 
     403 
     404void restore_zval (zval * TSRMLS_DC); 
     405void calc_zval (zval * z TSRMLS_DC); 
     406void store_zval (zval * z TSRMLS_DC); 
     407void fixup_zval (zval * z TSRMLS_DC); 
     408 
     409inline unsigned int hash_mm (const char *data, int len); 
     410 
     411#  ifdef WITH_EACCELERATOR_EXECUTOR 
     412ZEND_DLEXPORT void eaccelerator_execute (zend_op_array * op_array TSRMLS_DC); 
     413#  endif 
     414 
     415#  ifdef WITH_EACCELERATOR_OPTIMIZER 
     416void eaccelerator_optimize (zend_op_array * op_array); 
     417#  endif 
     418 
     419#ifdef WITH_EACCELERATOR_ENCODER 
     420PHP_FUNCTION (eaccelerator_encode); 
     421#endif 
     422#endif /* HAVE_EACCELERATOR_LOADER_STANDALONE */ 
     423 
     424#ifdef ZTS 
     425#  define MMCG(v) TSRMG(eaccelerator_globals_id, zend_eaccelerator_globals*, v) 
     426#else 
     427#  define MMCG(v) (eaccelerator_globals.v) 
     428#endif 
     429 
    396430/* 
    397431 * conditional filter 
     
    404438} mm_cond_entry; 
    405439 
    406 typedef union align_union { 
    407   double d; 
    408   void *v; 
    409   int (*func)(int); 
    410   long l; 
    411 } align_union; 
    412  
    413 /******************************************************************************/ 
    414  
    415 #ifdef ZTS 
    416 MUTEX_T mm_mutex; 
    417 #endif 
    418  
    419 void format_size (char *s, unsigned int size, int legend); 
    420 void eaccelerator_prune (time_t t); 
    421  
    422 int eaccelerator_lock (const char *key, int key_len TSRMLS_DC); 
    423 int eaccelerator_unlock (const char *key, int key_len TSRMLS_DC); 
    424  
    425 void *eaccelerator_malloc2 (size_t size TSRMLS_DC); 
    426  
    427 unsigned int eaccelerator_crc32 (const char *p, size_t n); 
    428 int eaccelerator_md5 (char *s, const char *prefix, const char *key TSRMLS_DC); 
    429  
    430 void restore_zval (zval * TSRMLS_DC); 
    431 void calc_zval (zval * z TSRMLS_DC); 
    432 void store_zval (zval * z TSRMLS_DC); 
    433 void fixup_zval (zval * z TSRMLS_DC); 
    434  
    435 inline unsigned int hash_mm (const char *data, int len); 
    436  
    437 #  ifdef WITH_EACCELERATOR_EXECUTOR 
    438 ZEND_DLEXPORT void eaccelerator_execute (zend_op_array * op_array TSRMLS_DC); 
    439 #  endif 
    440  
    441 #  ifdef WITH_EACCELERATOR_OPTIMIZER 
    442 void eaccelerator_optimize (zend_op_array * op_array); 
    443 #  endif 
    444  
    445 #ifdef WITH_EACCELERATOR_ENCODER 
    446 PHP_FUNCTION (eaccelerator_encode); 
    447 #endif 
    448  
    449440#ifdef WITH_EACCELERATOR_LOADER 
    450441zend_op_array *eaccelerator_load (char *src, int src_len TSRMLS_DC); 
     
    452443PHP_FUNCTION (_eaccelerator_loader_file); 
    453444PHP_FUNCTION (_eaccelerator_loader_line); 
    454 #endif 
    455445#endif 
    456446 
     
    509499 
    510500ZEND_EXTERN_MODULE_GLOBALS (eaccelerator) 
    511 #endif                                                  /*#ifndef INCLUDED_EACCELERATOR_H */ 
     501 
     502#define EACCELERATOR_EXTENSION_NAME "eAccelerator" 
     503#define EACCELERATOR_LOADER_EXTENSION_NAME "eLoader" 
     504 
     505#define MMC_ENCODER_VERSION   0x00000003 
     506#define MMC_ENCODER_END       0x00 
     507#define MMC_ENCODER_NAMESPACE 0x01 
     508#define MMC_ENCODER_CLASS     0x02 
     509#define MMC_ENCODER_FUNCTION  0x03 
     510 
     511#define EACCELERATOR_VERSION_GUID   "PHPE8EDA1B6-806A-4851-B1C8-A6B4712F44FB" 
     512#define EACCELERATOR_LOGO_GUID      "PHPE6F78DE9-13E4-4dee-8518-5FA2DACEA803" 
     513#define EACCELERATOR_VERSION_STRING ("eAccelerator " EACCELERATOR_VERSION " (PHP " PHP_VERSION ")") 
     514 
     515#endif          /* HAVE_EACCELERATOR */ 
     516#endif          /* #ifndef INCLUDED_EACCELERATOR_H */ 
  • eaccelerator/trunk/opcodes.c

    r44 r76  
    2828*/ 
    2929 
    30 #include "eaccelerator.h" 
    3130#include "opcodes.h" 
    3231