* renamed udd to ctx in qse_mmgr_t
* fixed problems in build and test scripts
This commit is contained in:
@ -49,7 +49,7 @@ public:
|
||||
this->alloc = alloc_mem;
|
||||
this->realloc = realloc_mem;
|
||||
this->free = free_mem;
|
||||
this->udd = this;
|
||||
this->ctx = this;
|
||||
}
|
||||
|
||||
///
|
||||
@ -90,17 +90,17 @@ protected:
|
||||
///
|
||||
/// bridge function from the #qse_mmgr_t type the allocMem() function.
|
||||
///
|
||||
static void* alloc_mem (void* udd, size_t n);
|
||||
static void* alloc_mem (void* ctx, size_t n);
|
||||
|
||||
///
|
||||
/// bridge function from the #qse_mmgr_t type the reallocMem() function.
|
||||
///
|
||||
static void* realloc_mem (void* udd, void* ptr, size_t n);
|
||||
static void* realloc_mem (void* ctx, void* ptr, size_t n);
|
||||
|
||||
///
|
||||
/// bridge function from the #qse_mmgr_t type the freeMem() function.
|
||||
///
|
||||
static void free_mem (void* udd, void* ptr);
|
||||
static void free_mem (void* ctx, void* ptr);
|
||||
};
|
||||
|
||||
/////////////////////////////////
|
||||
|
@ -118,7 +118,7 @@
|
||||
* }
|
||||
*
|
||||
* // complete the qse_mmgr_t interface by providing the allocator.
|
||||
* mmgr.udd = fma;
|
||||
* mmgr.ctx = fma;
|
||||
*
|
||||
* // initializes the statically declared red-black tree.
|
||||
* // can not call qse_rbt_open() which allocates the qse_rbt_t object.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mem.h 441 2011-04-22 14:28:43Z hyunghwan.chung $
|
||||
* $Id: mem.h 549 2011-08-14 09:07:31Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -42,22 +42,18 @@
|
||||
* The QSE_MMGR_ALLOC() macro allocates a memory block of the @a size bytes
|
||||
* using the @a mmgr memory manager.
|
||||
*/
|
||||
#define QSE_MMGR_ALLOC(mmgr,size) \
|
||||
((mmgr)->alloc((mmgr)->udd,size))
|
||||
#define QSE_MMGR_ALLOC(mmgr,size) ((mmgr)->alloc((mmgr)->ctx,size))
|
||||
|
||||
/**
|
||||
* The QSE_MMGR_REALLOC() macro resizes a memory block pointed to by @a ptr
|
||||
* to the @a size bytes using the @a mmgr memory manager.
|
||||
*/
|
||||
#define QSE_MMGR_REALLOC(mmgr,ptr,size) \
|
||||
((mmgr)->realloc((mmgr)->udd,ptr,size))
|
||||
#define QSE_MMGR_REALLOC(mmgr,ptr,size) ((mmgr)->realloc((mmgr)->ctx,ptr,size))
|
||||
|
||||
/**
|
||||
* The QSE_MMGR_FREE() macro deallocates the memory block pointed to by @a ptr.
|
||||
*/
|
||||
#define QSE_MMGR_FREE(mmgr,ptr) \
|
||||
((mmgr)->free((mmgr)->udd,ptr))
|
||||
|
||||
#define QSE_MMGR_FREE(mmgr,ptr) ((mmgr)->free((mmgr)->ctx,ptr))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: str.h 536 2011-08-06 03:25:08Z hyunghwan.chung $
|
||||
* $Id: str.h 549 2011-08-14 09:07:31Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -2236,6 +2236,9 @@ qse_mchar_t* qse_wcstombsdup (
|
||||
|
||||
QSE_DEFINE_COMMON_FUNCTIONS (mbs)
|
||||
|
||||
/**
|
||||
* The qse_mbs_open() function creates a dynamically resizable multibyte string.
|
||||
*/
|
||||
qse_mbs_t* qse_mbs_open (
|
||||
qse_mmgr_t* mmgr,
|
||||
qse_size_t ext,
|
||||
@ -2405,6 +2408,11 @@ qse_size_t qse_mbs_pac (
|
||||
|
||||
QSE_DEFINE_COMMON_FUNCTIONS (wcs)
|
||||
|
||||
|
||||
/**
|
||||
* The qse_wcs_open() function creates a dynamically resizable wide-character
|
||||
* string.
|
||||
*/
|
||||
qse_wcs_t* qse_wcs_open (
|
||||
qse_mmgr_t* mmgr,
|
||||
qse_size_t ext,
|
||||
|
Reference in New Issue
Block a user