diff --git a/H/GLOBALS b/H/GLOBALS index 29719a756..6d1bfdbb6 100755 --- a/H/GLOBALS +++ b/H/GLOBALS @@ -38,12 +38,6 @@ UInt SizeOfOverflow =0 UInt AGcThreshold =10000 Agc_hook AGCHook =NULL -#if __ANDROID__ -// no need to perform initialization, it is done before we start the Prolog engine. -struct AAssetManager* assetManager =NULL -char* AssetsWD =NULL -#endif - /* multi-thread support */ #if THREADS /* number of threads and processes in system */ @@ -173,5 +167,6 @@ struct AliasDescS* FileAliases =Yap_InitStandardAliases() int NOfFileAliases void int SzOfFileAliases void +struct vfs* VFS =Yap_InitAssetManager() END_GLOBAL_DATA diff --git a/H/generated/dglobals.h b/H/generated/dglobals.h index 490aa16ed..7e4d5f390 100644 --- a/H/generated/dglobals.h +++ b/H/generated/dglobals.h @@ -36,11 +36,6 @@ #define GLOBAL_AGcThreshold Yap_global->AGcThreshold_ #define GLOBAL_AGCHook Yap_global->AGCHook_ -#if __ANDROID__ - -#define GLOBAL_assetManager Yap_global->assetManager_ -#define GLOBAL_AssetsWD Yap_global->AssetsWD_ -#endif #if THREADS @@ -145,4 +140,5 @@ #define GLOBAL_FileAliases Yap_global->FileAliases_ #define GLOBAL_NOfFileAliases Yap_global->NOfFileAliases_ #define GLOBAL_SzOfFileAliases Yap_global->SzOfFileAliases_ +#define GLOBAL_VFS Yap_global->VFS_ diff --git a/H/generated/dhstruct.h b/H/generated/dhstruct.h index fead49e0b..f3a567948 100644 --- a/H/generated/dhstruct.h +++ b/H/generated/dhstruct.h @@ -30,11 +30,7 @@ -#define Yap_HoleSize Yap_heap_regs->Yap_HoleSize_ -#define Yap_av Yap_heap_regs->Yap_av_ #if USE_DL_MALLOC -#define void Yap_heap_regs->void_ -#define Yap_NOfMemoryHoles Yap_heap_regs->Yap_NOfMemoryHoles_ #if defined(YAPOR) || defined(THREADS) #define DLMallocLock Yap_heap_regs->DLMallocLock_ #endif @@ -52,7 +48,7 @@ #define HeapLim Yap_heap_regs->HeapLim_ #define FreeBlocks Yap_heap_regs->FreeBlocks_ #if defined(YAPOR) || defined(THREADS) -#define FreeBlocksLock Yap_heap_regs->FreeBlocksLock_ +#define fFreeBlocksLock Yap_heap_regs->FreeBlocksLock_ #define HeapUsedLock Yap_heap_regs->HeapUsedLock_ #define HeapTopLock Yap_heap_regs->HeapTopLock_ #define HeapTopOwner Yap_heap_regs->HeapTopOwner_ diff --git a/H/generated/h0globals.h b/H/generated/h0globals.h index 79e9cf9be..bf70ea08b 100644 --- a/H/generated/h0globals.h +++ b/H/generated/h0globals.h @@ -36,11 +36,6 @@ EXTERNAL UInt GLOBAL_SizeOfOverflow; // amount of space recovered in all garbage collections EXTERNAL UInt GLOBAL_AGcThreshold; EXTERNAL Agc_hook GLOBAL_AGCHook; -#if __ANDROID__ -// no need to perform initialization, it is done before we start the Prolog engine. -EXTERNAL struct AAssetManager* GLOBAL_assetManager; -EXTERNAL char* GLOBAL_AssetsWD; -#endif /* multi-thread support */ #if THREADS /* number of threads and processes in system */ @@ -145,4 +140,5 @@ EXTERNAL int GLOBAL_MaxPriority; EXTERNAL struct AliasDescS* GLOBAL_FileAliases; EXTERNAL int GLOBAL_NOfFileAliases; EXTERNAL int GLOBAL_SzOfFileAliases; +EXTERNAL struct vfs* GLOBAL_VFS; diff --git a/H/generated/h0struct.h b/H/generated/h0struct.h index e3172dd1d..d3a8ee61f 100644 --- a/H/generated/h0struct.h +++ b/H/generated/h0struct.h @@ -31,9 +31,9 @@ /* memory management */ EXTERNAL UInt Yap_HoleSize; -EXTERNAL struct malloc_state *Yap_av; #if USE_DL_MALLOC -EXTERNAL struct Yap_MemoryHoles[MAX_DLMALLOC_HOLES] void; +EXTERNAL struct malloc_state *Yap_av; +EXTERNAL struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]; EXTERNAL UInt Yap_NOfMemoryHoles; #if defined(YAPOR) || defined(THREADS) EXTERNAL lockvar DLMallocLock; diff --git a/H/generated/hglobals.h b/H/generated/hglobals.h index b2b7643f4..cf351dc14 100644 --- a/H/generated/hglobals.h +++ b/H/generated/hglobals.h @@ -36,11 +36,6 @@ typedef struct global_data { // amount of space recovered in all garbage collections UInt AGcThreshold_; Agc_hook AGCHook_; -#if __ANDROID__ -// no need to perform initialization, it is done before we start the Prolog engine. - struct AAssetManager* assetManager_; - char* AssetsWD_; -#endif /* multi-thread support */ #if THREADS /* number of threads and processes in system */ @@ -145,4 +140,5 @@ const char* RestoreFile_; struct AliasDescS* FileAliases_; int NOfFileAliases_; int SzOfFileAliases_; + struct vfs* VFS_; } w_shared; diff --git a/H/generated/hstruct.h b/H/generated/hstruct.h index 98b6101dc..863b7e35e 100755 --- a/H/generated/hstruct.h +++ b/H/generated/hstruct.h @@ -31,9 +31,9 @@ /* memory management */ UInt Yap_HoleSize_; - struct malloc_state *Yap_av_; #if USE_DL_MALLOC - struct Yap_MemoryHoles[MAX_DLMALLOC_HOLES] void_; + struct malloc_state *Yap_av_; + struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]_; UInt Yap_NOfMemoryHoles_; #if defined(YAPOR) || defined(THREADS) lockvar DLMallocLock_; diff --git a/H/generated/iglobals.h b/H/generated/iglobals.h index a408c77ce..49481f73f 100644 --- a/H/generated/iglobals.h +++ b/H/generated/iglobals.h @@ -36,11 +36,6 @@ static void InitGlobal(void) { GLOBAL_AGcThreshold = 10000; GLOBAL_AGCHook = NULL; -#if __ANDROID__ - - GLOBAL_assetManager = NULL; - GLOBAL_AssetsWD = NULL; -#endif #if THREADS @@ -145,4 +140,5 @@ static void InitGlobal(void) { GLOBAL_FileAliases = Yap_InitStandardAliases(); + GLOBAL_VFS = Yap_InitAssetManager(); } diff --git a/H/generated/ihstruct.h b/H/generated/ihstruct.h index a88fb4fa1..4909f58ab 100644 --- a/H/generated/ihstruct.h +++ b/H/generated/ihstruct.h @@ -27,14 +27,10 @@ - - #if USE_DL_MALLOC - - #if defined(YAPOR) || defined(THREADS) INIT_LOCK(DLMallocLock); #endif diff --git a/H/generated/rhstruct.h b/H/generated/rhstruct.h index eabdc9284..1c8faa7e0 100644 --- a/H/generated/rhstruct.h +++ b/H/generated/rhstruct.h @@ -27,14 +27,10 @@ - - #if USE_DL_MALLOC - - #if defined(YAPOR) || defined(THREADS) REINIT_LOCK(DLMallocLock); #endif