From 647ebac5e4d544a57b44f9d4e8f58bb0c62c79b0 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 17 Jun 2016 16:42:26 +0100 Subject: [PATCH] Android && avoid mem size trouble --- H/LOCALS | 14 ++++---------- H/generated/dlocals.h | 9 ++------- H/generated/hlocals.h | 6 +----- H/generated/ilocals.h | 6 +----- H/generated/rlocals.h | 4 ---- 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/H/LOCALS b/H/LOCALS index 2c024e656..01c95b1ff 100755 --- a/H/LOCALS +++ b/H/LOCALS @@ -11,6 +11,7 @@ bool sockets_io =false bool within_print_message =false // + // Used by the prompts to check if they are after a newline, and then a // prompt should be output, or if we are in the middle of a line. // @@ -215,8 +216,8 @@ wchar_t* CommentsBuff void size_t CommentsBuffPos void size_t CommentsBuffLim void sigjmp_buf RestartEnv void -char FileNameBuf[YAP_FILENAME_MAX] void -char FileNameBuf2[YAP_FILENAME_MAX] void +char FileNameBuf[YAP_FILENAME_MAX+1] void +char FileNameBuf2[YAP_FILENAME_MAX+1] void // Prolog State UInt BreakLevel =0 @@ -294,14 +295,6 @@ UInt ImportDBRefHashTableSize =0 UInt ImportDBRefHashTableNum =0 yamop *ImportFAILCODE =NULL - -#if __ANDROID__ -// current virtual directory. -struct AAssetManager* assetManager =GLOBAL_assetManager -char* InAssetDir =NULL -#endif - - // exo indexing UInt ibnds[256] void @@ -316,6 +309,7 @@ struct pred_entry* SearchPreds void // Slots yhandle_t CurSlot =0 +yhandle_t FrozenHandles =0 yhandle_t NSlots =0 CELL* SlotBase =InitHandles(wid) diff --git a/H/generated/dlocals.h b/H/generated/dlocals.h index cb9c76e32..866c1a0b8 100644 --- a/H/generated/dlocals.h +++ b/H/generated/dlocals.h @@ -453,13 +453,6 @@ #define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_ #define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_ #define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_ -#if __ANDROID__ - -#define LOCAL_assetManager LOCAL->assetManager_ -#define REMOTE_assetManager(wid) REMOTE(wid)->assetManager_ -#define LOCAL_InAssetDir LOCAL->InAssetDir_ -#define REMOTE_InAssetDir(wid) REMOTE(wid)->InAssetDir_ -#endif #define LOCAL_ibnds LOCAL->ibnds_ #define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_ @@ -479,6 +472,8 @@ #define LOCAL_CurSlot LOCAL->CurSlot_ #define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_ +#define LOCAL_FrozenHandles LOCAL->FrozenHandles_ +#define REMOTE_FrozenHandles(wid) REMOTE(wid)->FrozenHandles_ #define LOCAL_NSlots LOCAL->NSlots_ #define REMOTE_NSlots(wid) REMOTE(wid)->NSlots_ #define LOCAL_SlotBase LOCAL->SlotBase_ diff --git a/H/generated/hlocals.h b/H/generated/hlocals.h index e3b5ac788..63f27dcd1 100644 --- a/H/generated/hlocals.h +++ b/H/generated/hlocals.h @@ -255,11 +255,6 @@ const char* Error_Function_; UInt ImportDBRefHashTableSize_; UInt ImportDBRefHashTableNum_; yamop *ImportFAILCODE_; -#if __ANDROID__ -// current virtual directory. - struct AAssetManager* assetManager_; - char* InAssetDir_; -#endif // exo indexing UInt ibnds_[256]; struct index_t* exo_it_; @@ -271,6 +266,7 @@ const char* Error_Function_; struct pred_entry* SearchPreds_; // Slots yhandle_t CurSlot_; + yhandle_t FrozenHandles_; yhandle_t NSlots_; CELL* SlotBase_; // Mutexes diff --git a/H/generated/ilocals.h b/H/generated/ilocals.h index 577a2187f..9bec428c9 100755 --- a/H/generated/ilocals.h +++ b/H/generated/ilocals.h @@ -255,11 +255,6 @@ static void InitWorker(int wid) { REMOTE_ImportDBRefHashTableSize(wid) = 0; REMOTE_ImportDBRefHashTableNum(wid) = 0; REMOTE_ImportFAILCODE(wid) = NULL; -#if __ANDROID__ - - REMOTE_assetManager(wid) = GLOBAL_assetManager; - REMOTE_InAssetDir(wid) = NULL; -#endif REMOTE_exo_it(wid) = NULL; @@ -271,6 +266,7 @@ static void InitWorker(int wid) { REMOTE_CurSlot(wid) = 0; + REMOTE_FrozenHandles(wid) = 0; REMOTE_NSlots(wid) = 0; REMOTE_SlotBase(wid) = InitHandles(wid); diff --git a/H/generated/rlocals.h b/H/generated/rlocals.h index 3125c81e8..973442185 100644 --- a/H/generated/rlocals.h +++ b/H/generated/rlocals.h @@ -255,13 +255,9 @@ static void RestoreWorker(int wid USES_REGS) { -#if __ANDROID__ -#endif - -