CVS update: php3/functions
| From: | thies | Date: | Thu, 11 Feb 1999 09:12:48 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4035@lists.php.net to get a copy of this message | ||
Date: Thursday February 11, 1999 @ 4:12
Author: thies
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv2317
Modified Files:
oci8.c
Log Message:
now even the deallocation of the connection-context works correct.
we from now on use the php memory manager for the oci internals as well (search for ocimalloc)!
Index: php3/functions/oci8.c
diff -c php3/functions/oci8.c:1.36 php3/functions/oci8.c:1.37
*** php3/functions/oci8.c:1.36 Wed Feb 10 12:51:50 1999
--- php3/functions/oci8.c Thu Feb 11 04:12:48 1999
***************
*** 1,4 ****
! #define OCI8_USE_EMALLOC 0
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
--- 1,4 ----
! #define OCI8_USE_EMALLOC 1 /* set this to 1 if you want to use the php memory manager! */
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
***************
*** 32,38 ****
+----------------------------------------------------------------------+
*/
! /* $Id: oci8.c,v 1.36 1999/02/10 17:51:50 thies Exp $ */
#include "php.h"
#include "internal_functions.h"
--- 32,38 ----
+----------------------------------------------------------------------+
*/
! /* $Id: oci8.c,v 1.37 1999/02/11 09:12:48 thies Exp $ */
#include "php.h"
#include "internal_functions.h"
***************
*** 353,377 ****
/* {{{ debug malloc/realloc/free */
#if OCI8_USE_EMALLOC
! CONST dvoid *mymalloc(dvoid *ctx, size_t size)
{
dvoid *ret;
! oci8_debug("mymalloc(%d)\n", size);
ret = (dvoid *)emalloc(size);
return ret;
}
! CONST dvoid *myrealloc(dvoid *ctx, dvoid *ptr, size_t size)
{
dvoid *ret;
! oci8_debug("myrealloc(%08x, %d)\n", ptr, size);
ret = (dvoid *)erealloc(ptr, size);
return ptr;
}
! CONST void myfree(dvoid *ctx, dvoid *ptr)
{
! oci8_debug("myfree(%08x)\n", ptr);
efree(ptr);
}
#endif
--- 353,377 ----
/* {{{ debug malloc/realloc/free */
#if OCI8_USE_EMALLOC
! CONST dvoid *ocimalloc(dvoid *ctx, size_t size)
{
dvoid *ret;
! oci8_debug("ocimalloc(%d)", size);
ret = (dvoid *)emalloc(size);
return ret;
}
! CONST dvoid *ocirealloc(dvoid *ctx, dvoid *ptr, size_t size)
{
dvoid *ret;
! oci8_debug("ocirealloc(%08x, %d)", ptr, size);
ret = (dvoid *)erealloc(ptr, size);
return ptr;
}
! CONST void ocifree(dvoid *ctx, dvoid *ptr)
{
! oci8_debug("ocifree(%08x)", ptr);
efree(ptr);
}
#endif
***************
*** 459,467 ****
efree(connection->descriptors);
connection->open = 0;
! oci8_error(connection->pError, "OCILogoff",
! OCILogoff(connection->pServiceContext,
! connection->pError));
OCI8_GLOBAL(php3_oci8_module).num_links--;
efree(connection);
}
--- 459,483 ----
efree(connection->descriptors);
connection->open = 0;
!
! oci8_error(connection->pError,"OCISessionEnd",
! OCISessionEnd(connection->pServiceContext, connection->pError, connection->pSession,
(ub4) 0));
!
! oci8_error(connection->pError,"OCIServerDetach",
! OCIServerDetach(connection->pServer, connection->pError, (ub4) OCI_DEFAULT));
!
! /* from Oracle Doc: All handles may be explicitly deallocated.
! The OCI will deallocate a child handle if the parent is deallocated.
!
! OCIHandleFree((dvoid *)connection->pServiceContext, OCI_HTYPE_SVCCTX);
! OCIHandleFree((dvoid *)connection->pError, OCI_HTYPE_ERROR);
! OCIHandleFree((dvoid *)connection->pServer, OCI_HTYPE_SERVER);
! OCIHandleFree((dvoid *)connection->pSession, OCI_HTYPE_SESSION);
! */
! if (OCIHandleFree((dvoid *)connection->pEnv, OCI_HTYPE_ENV) != OCI_SUCCESS) {
! oci8_debug("oci8_close_conn: OCIHandleFree returned error");
! }
!
OCI8_GLOBAL(php3_oci8_module).num_links--;
efree(connection);
}
***************
*** 1847,1853 ****
/* Set up the Oracle environment. */
#if OCI8_USE_EMALLOC
! OCIInitialize(OCI_DEFAULT, (dvoid *)connection, mymalloc, myrealloc, myfree);
#else
OCIInitialize(OCI_DEFAULT, NULL, NULL, NULL, NULL);
#endif
--- 1863,1869 ----
/* Set up the Oracle environment. */
#if OCI8_USE_EMALLOC
! OCIInitialize(OCI_DEFAULT, (dvoid *)connection, ocimalloc, ocirealloc, ocifree);
#else
OCIInitialize(OCI_DEFAULT, NULL, NULL, NULL, NULL);
#endif
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net