From 11dec146217c5080e3eb9f5cd495d828dbdf8945 Mon Sep 17 00:00:00 2001 From: Per Cederqvist <ceder@lysator.liu.se> Date: Sun, 31 May 1992 01:08:14 +0000 Subject: [PATCH] Use the allocator from the configuration to create an IscMaster in isc_initialize(). --- src/libraries/libisc-new/src/ChangeLog | 4 ++++ src/libraries/libisc-new/src/isc_master.c | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/libraries/libisc-new/src/ChangeLog diff --git a/src/libraries/libisc-new/src/ChangeLog b/src/libraries/libisc-new/src/ChangeLog new file mode 100644 index 000000000..7e44503a5 --- /dev/null +++ b/src/libraries/libisc-new/src/ChangeLog @@ -0,0 +1,4 @@ +Sun May 31 01:49:22 1992 Per Cederqvist (ceder@lysator) + + * isc_master (isc_initialize): Allocate the master control block + with the allocator that is passed in IscConfig (if any). diff --git a/src/libraries/libisc-new/src/isc_master.c b/src/libraries/libisc-new/src/isc_master.c index ccf8ab82f..151f37c34 100644 --- a/src/libraries/libisc-new/src/isc_master.c +++ b/src/libraries/libisc-new/src/isc_master.c @@ -26,10 +26,24 @@ isc_initialize(IscConfig * cfg) IscMaster * mcb; IscMasterConfig * mcfg; IscSessionConfig * scfg; - - + + /* Make sure the mcb is allocated using the correct allocator. */ + if (cfg && cfg->version == 1005 && cfg->master.version == 1001) + { + if (cfg->master.memfn.alloc && cfg->master.memfn.realloc + && cfg->master.memfn.free) + { + isc_setallocfn(cfg->master.memfn.alloc, + cfg->master.memfn.realloc, + cfg->master.memfn.free); + } + + if (cfg->master.abortfn) + isc_setabortfn(cfg->master.abortfn); + } + ISC_XNEW(mcb); - + mcb->sessions = NULL; -- GitLab