used hcl_openstdwithmmgr() in hcl-s.c and deleted unneeded code
This commit is contained in:
		| @ -41,12 +41,6 @@ | |||||||
| #if defined(_WIN32) | #if defined(_WIN32) | ||||||
| #	include <windows.h> | #	include <windows.h> | ||||||
| #	include <tchar.h> | #	include <tchar.h> | ||||||
| #	if defined(HCL_HAVE_CFG_H) && defined(HCL_ENABLE_LIBLTDL) |  | ||||||
| #		include <ltdl.h> |  | ||||||
| #		define USE_LTDL |  | ||||||
| #	else |  | ||||||
| #		define USE_WIN_DLL |  | ||||||
| #	endif |  | ||||||
| #elif defined(__OS2__) | #elif defined(__OS2__) | ||||||
| #	define INCL_DOSMODULEMGR | #	define INCL_DOSMODULEMGR | ||||||
| #	define INCL_DOSPROCESS | #	define INCL_DOSPROCESS | ||||||
| @ -59,19 +53,6 @@ | |||||||
| #	include <Timer.h> | #	include <Timer.h> | ||||||
| #else | #else | ||||||
|  |  | ||||||
| #	if defined(HCL_ENABLE_LIBLTDL) |  | ||||||
| #		include <ltdl.h> |  | ||||||
| #		define USE_LTDL |  | ||||||
| #	elif defined(HAVE_DLFCN_H) |  | ||||||
| #		include <dlfcn.h> |  | ||||||
| #		define USE_DLFCN |  | ||||||
| #	elif defined(__APPLE__) || defined(__MACOSX__) |  | ||||||
| #		define USE_MACH_O_DYLD |  | ||||||
| #		include <mach-o/dyld.h> |  | ||||||
| #	else |  | ||||||
| #		error UNSUPPORTED DYNAMIC LINKER |  | ||||||
| #	endif |  | ||||||
|  |  | ||||||
| #	if defined(HAVE_TIME_H) | #	if defined(HAVE_TIME_H) | ||||||
| #		include <time.h> | #		include <time.h> | ||||||
| #	endif | #	endif | ||||||
| @ -100,40 +81,6 @@ | |||||||
| #	include <poll.h> | #	include <poll.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #if !defined(HCL_DEFAULT_PFMODDIR) |  | ||||||
| #	define HCL_DEFAULT_PFMODDIR "" |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #if !defined(HCL_DEFAULT_PFMODPREFIX) |  | ||||||
| #	if defined(_WIN32) |  | ||||||
| #		define HCL_DEFAULT_PFMODPREFIX "hcl-" |  | ||||||
| #	elif defined(__OS2__) |  | ||||||
| #		define HCL_DEFAULT_PFMODPREFIX "hcl" |  | ||||||
| #	elif defined(__DOS__) |  | ||||||
| #		define HCL_DEFAULT_PFMODPREFIX "hcl" |  | ||||||
| #	else |  | ||||||
| #		define HCL_DEFAULT_PFMODPREFIX "libhcl-" |  | ||||||
| #	endif |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| #if !defined(HCL_DEFAULT_PFMODPOSTFIX) |  | ||||||
| #	if defined(_WIN32) |  | ||||||
| #		define HCL_DEFAULT_PFMODPOSTFIX "" |  | ||||||
| #	elif defined(__OS2__) |  | ||||||
| #		define HCL_DEFAULT_PFMODPOSTFIX "" |  | ||||||
| #	elif defined(__DOS__) |  | ||||||
| #		define HCL_DEFAULT_PFMODPOSTFIX "" |  | ||||||
| #	else |  | ||||||
| #		if defined(USE_DLFCN) |  | ||||||
| #			define HCL_DEFAULT_PFMODPOSTFIX ".so" |  | ||||||
| #		elif defined(USE_MACH_O_DYLD) |  | ||||||
| #			define HCL_DEFAULT_PFMODPOSTFIX ".dylib" |  | ||||||
| #		else |  | ||||||
| #			define HCL_DEFAULT_PFMODPOSTFIX "" |  | ||||||
| #		endif |  | ||||||
| #	endif |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| struct bb_t | struct bb_t | ||||||
| { | { | ||||||
| 	char buf[1024]; | 	char buf[1024]; | ||||||
| @ -712,6 +659,7 @@ hcl_server_proto_t* hcl_server_proto_open (hcl_oow_t xtnsize, hcl_server_worker_ | |||||||
| 	worker_hcl_xtn_t* xtn; | 	worker_hcl_xtn_t* xtn; | ||||||
| 	hcl_bitmask_t trait; | 	hcl_bitmask_t trait; | ||||||
|  |  | ||||||
|  | #if 0 | ||||||
| 	HCL_MEMSET (&vmprim, 0, HCL_SIZEOF(vmprim)); | 	HCL_MEMSET (&vmprim, 0, HCL_SIZEOF(vmprim)); | ||||||
| 	if (worker->server->cfg.trait & HCL_SERVER_TRAIT_USE_LARGE_PAGES) | 	if (worker->server->cfg.trait & HCL_SERVER_TRAIT_USE_LARGE_PAGES) | ||||||
| 	{ | 	{ | ||||||
| @ -728,6 +676,7 @@ hcl_server_proto_t* hcl_server_proto_open (hcl_oow_t xtnsize, hcl_server_worker_ | |||||||
| 	vmprim.dl_getsym = hcl_vmprim_dl_getsym; | 	vmprim.dl_getsym = hcl_vmprim_dl_getsym; | ||||||
| 	vmprim.vm_gettime = hcl_vmprim_vm_gettime; | 	vmprim.vm_gettime = hcl_vmprim_vm_gettime; | ||||||
| 	vmprim.vm_sleep = hcl_vmprim_vm_sleep; | 	vmprim.vm_sleep = hcl_vmprim_vm_sleep; | ||||||
|  | #endif | ||||||
|  |  | ||||||
| 	proto = (hcl_server_proto_t*)hcl_server_allocmem(worker->server, HCL_SIZEOF(*proto)); | 	proto = (hcl_server_proto_t*)hcl_server_allocmem(worker->server, HCL_SIZEOF(*proto)); | ||||||
| 	if (!proto) return HCL_NULL; | 	if (!proto) return HCL_NULL; | ||||||
| @ -736,7 +685,12 @@ hcl_server_proto_t* hcl_server_proto_open (hcl_oow_t xtnsize, hcl_server_worker_ | |||||||
| 	proto->worker = worker; | 	proto->worker = worker; | ||||||
| 	proto->exec_runtime_event_index = HCL_TMR_INVALID_INDEX; | 	proto->exec_runtime_event_index = HCL_TMR_INVALID_INDEX; | ||||||
|  |  | ||||||
| 	proto->hcl = hcl_open(hcl_server_getmmgr(proto->worker->server), HCL_SIZEOF(*xtn), worker->server->cfg.actor_heap_size, &vmprim, HCL_NULL); | #if 0 | ||||||
|  | 	/*proto->hcl = hcl_open(hcl_server_getmmgr(proto->worker->server), HCL_SIZEOF(*xtn), worker->server->cfg.actor_heap_size, &vmprim, HCL_NULL);*/ | ||||||
|  | #endif | ||||||
|  | 	/* TODO: set the log write handerl to log_write .. */ | ||||||
|  | 	/* TODO: LARGE_PAGES */ | ||||||
|  | 	proto->hcl = hcl_openstdwithmmgr(hcl_server_getmmgr(proto->worker->server), HCL_SIZEOF(*xtn), worker->server->cfg.actor_heap_size, HCL_NULL); | ||||||
| 	if (!proto->hcl) goto oops; | 	if (!proto->hcl) goto oops; | ||||||
|  |  | ||||||
| 	xtn = (worker_hcl_xtn_t*)hcl_getxtn(proto->hcl); | 	xtn = (worker_hcl_xtn_t*)hcl_getxtn(proto->hcl); | ||||||
| @ -1602,10 +1556,6 @@ hcl_server_t* hcl_server_open (hcl_mmgr_t* mmgr, hcl_oow_t xtnsize, hcl_server_p | |||||||
| 	vmprim.vm_gettime = hcl_vmprim_vm_gettime; | 	vmprim.vm_gettime = hcl_vmprim_vm_gettime; | ||||||
| 	vmprim.vm_sleep = hcl_vmprim_vm_sleep; | 	vmprim.vm_sleep = hcl_vmprim_vm_sleep; | ||||||
|  |  | ||||||
| #if defined(USE_LTDL) |  | ||||||
| 	lt_dlinit (); |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| 	hcl = hcl_open(mmgr, HCL_SIZEOF(*xtn), 2048, &vmprim, errnum); | 	hcl = hcl_open(mmgr, HCL_SIZEOF(*xtn), 2048, &vmprim, errnum); | ||||||
| 	if (!hcl) goto oops; | 	if (!hcl) goto oops; | ||||||
|  |  | ||||||
|  | |||||||
| @ -1746,6 +1746,13 @@ HCL_EXPORT hcl_t* hcl_open ( | |||||||
| 	hcl_errnum_t*       errnum | 	hcl_errnum_t*       errnum | ||||||
| ); | ); | ||||||
|  |  | ||||||
|  | HCL_EXPORT hcl_t* hcl_openstdwithmmgr ( | ||||||
|  | 	hcl_mmgr_t*         mmgr, | ||||||
|  | 	hcl_oow_t           xtnsize, | ||||||
|  | 	hcl_oow_t           heapsize, | ||||||
|  | 	hcl_errnum_t*       errnum | ||||||
|  | ); | ||||||
|  |  | ||||||
| HCL_EXPORT hcl_t* hcl_openstd ( | HCL_EXPORT hcl_t* hcl_openstd ( | ||||||
| 	hcl_oow_t           xtnsize, | 	hcl_oow_t           xtnsize, | ||||||
| 	hcl_oow_t           heapsize, | 	hcl_oow_t           heapsize, | ||||||
|  | |||||||
| @ -2868,7 +2868,7 @@ static void cb_vm_cleanup (hcl_t* hcl) | |||||||
|  * STANDARD HCL |  * STANDARD HCL | ||||||
|  * ----------------------------------------------------------------- */ |  * ----------------------------------------------------------------- */ | ||||||
|  |  | ||||||
| hcl_t* hcl_openstd (hcl_oow_t xtnsize, hcl_oow_t heapsize, hcl_errnum_t* errnum) | hcl_t* hcl_openstdwithmmgr (hcl_mmgr_t* mmgr, hcl_oow_t xtnsize, hcl_oow_t heapsize, hcl_errnum_t* errnum) | ||||||
| { | { | ||||||
| 	hcl_t* hcl; | 	hcl_t* hcl; | ||||||
| 	hcl_vmprim_t vmprim; | 	hcl_vmprim_t vmprim; | ||||||
| @ -2895,7 +2895,7 @@ hcl_t* hcl_openstd (hcl_oow_t xtnsize, hcl_oow_t heapsize, hcl_errnum_t* errnum) | |||||||
| 	vmprim.vm_muxwait = vm_muxwait; | 	vmprim.vm_muxwait = vm_muxwait; | ||||||
| 	vmprim.vm_sleep = vm_sleep; | 	vmprim.vm_sleep = vm_sleep; | ||||||
|  |  | ||||||
| 	hcl = hcl_open(&sys_mmgr, HCL_SIZEOF(xtn_t) + xtnsize, heapsize, &vmprim, errnum); | 	hcl = hcl_open(mmgr, HCL_SIZEOF(xtn_t) + xtnsize, heapsize, &vmprim, errnum); | ||||||
| 	if (HCL_UNLIKELY(!hcl)) return HCL_NULL; | 	if (HCL_UNLIKELY(!hcl)) return HCL_NULL; | ||||||
|  |  | ||||||
| 	/* adjust the object size by the sizeof xtn_t so that moo_getxtn() returns the right pointer. */ | 	/* adjust the object size by the sizeof xtn_t so that moo_getxtn() returns the right pointer. */ | ||||||
| @ -2917,3 +2917,8 @@ hcl_t* hcl_openstd (hcl_oow_t xtnsize, hcl_oow_t heapsize, hcl_errnum_t* errnum) | |||||||
|  |  | ||||||
| 	return hcl; | 	return hcl; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | hcl_t* hcl_openstd (hcl_oow_t xtnsize, hcl_oow_t heapsize, hcl_errnum_t* errnum) | ||||||
|  | { | ||||||
|  | 	return hcl_openstdwithmmgr(&sys_mmgr, xtnsize, heapsize, errnum); | ||||||
|  | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user