2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
2008-06-15 00:16:40 +02:00
|
|
|
* Adriano dos Santos Fernandes
|
2001-05-23 15:26:42 +02:00
|
|
|
*/
|
2008-06-15 00:16:40 +02:00
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include "ib_udf.h"
|
2008-06-15 00:16:40 +02:00
|
|
|
#include "firebird.h"
|
|
|
|
#include "../jrd/common.h"
|
|
|
|
|
2009-06-09 10:40:36 +02:00
|
|
|
typedef void* VoidPtr;
|
|
|
|
|
2008-06-15 00:16:40 +02:00
|
|
|
|
2008-07-12 23:23:42 +02:00
|
|
|
// initialized by the engine
|
|
|
|
static void* (*allocFunc)(long) = NULL;
|
2008-06-15 00:16:40 +02:00
|
|
|
|
2009-06-09 12:31:31 +02:00
|
|
|
extern "C" void FB_DLL_EXPORT ib_util_init(void* (*aAllocFunc)(long))
|
2008-06-15 00:16:40 +02:00
|
|
|
{
|
2008-07-12 23:23:42 +02:00
|
|
|
allocFunc = aAllocFunc;
|
2008-06-15 00:16:40 +02:00
|
|
|
}
|
|
|
|
|
2009-06-09 12:31:31 +02:00
|
|
|
extern "C" VoidPtr FB_DLL_EXPORT ib_util_malloc(long size)
|
2001-05-23 15:26:42 +02:00
|
|
|
{
|
2008-07-12 23:23:42 +02:00
|
|
|
return allocFunc ? allocFunc(size) : NULL;
|
2001-05-23 15:26:42 +02:00
|
|
|
}
|