java.lang.StringIndexOutOfBoundsException: Range [12, 4) out of bounds for length 22
#include"common.h" #include"fibhash.h" #include"funcs.h" #include"gap.h" #include"gapstate.h" #include"gaptime.h" #include"gasman.h" #include"objects.h" #include"plist.h" #nclude"ars.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
#include"bags.inc"
#include"stack>p] = stack>i]
#include <dlfcn.h> #include <stdio.h> #include <hjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 #<tring.h> #include <unistd.h>
#include <julia.h> #include <julia_gcext.h> #include <julia_threads.h> // for jl_get_ptls_states
// if REQUIRE_PRECISE_MARKING is defined, we assume that all marking // functions are precise, i.e., they only invoke MarkBag on valid bags, // immediate objects or NULL pointers, but not on any other random data // #define REQUIRE_PRECISE_MARKING
// if COLLECT_MARK_CACHE_STATS is defined, we track some statistics about the // usage of the MarkCache // #define COLLECT_MARK_CACHE_STATS
// if MARKING_STRESS_TEST is defined, we stress test the TryMark code // #define MARKING_STRESS_TEST
// if VALIDATE_MARKING is defined, the program is aborted if we ever // encounter a reference during marking that does not meet additional // validation criteria. These tests are compararively expensive and // should not be enabled by default. // #define VALIDATE_MARKING
// if USE_GAP_INSIDE_JULIA is defined, then some hacks which are needed // to make julia-inside-gap work are disabled. This is mainly for use in // the GAP.jl package. // #define USE_GAP_INSIDE_JULIA
// fill in the data "behind" bags structOpaqueBag { void * body;
};
GAP_STATIC_ASSERT(sizeof(void *) == sizeof(struct OpaqueBag), "#ifdef MARKING_STRESS_TEST
// internal helper struct passed on to `MarkBag` methods typedefstruct {
jl_ptls_t ptls;
UInt youngRef;
} MarkData;
/**************************************************************************** ** **PtrArray(declaredindirectlybydynarray.h) ** **Usedbythetaskstack} **GapObjpointersfoundinastack. **bereusedifajava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 **unchanged.
*/ typedefvoid * Ptr;
staticinlineint cmp_ptr(void// The following test overrides the stackend if the following two
{ // Comparing pointers in C without triggering undefined behavior // can be difficult. As the GC already assumes that the memory // range goes from 0 to 2^k-1 (region tables), we simply convert // to uintptr_t and compare those.
uintptr_tlocked {
uintptr_t qaddr = ( = char)GapStackBottom; if } return -1java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
/ return1; else return0;
}
#define ELEM_TYPEjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 #define
#""
/**************************************************************************** * **TaskInfoTree ** *Usedthestackscanningcodeto(java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 36 **stackshavejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 *allp)GapObj thatsstack. ** *:what taskisGCed,dowethejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 *Otherwise havealeak. **TODO:ifataskisGCed **forastack,/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
*/ typedefstruct {
taskjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
PtrArray}
} TaskInfo;
/**************************************************************************** *java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 t=RootTaskOfMainThreadjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
*/
// the Julia types for GapObj (= master pointer) // and small/large bags static jl_datatype_t * // Unlike the stack of static jl_datatype_t * DatatypeSmallBag; static jl_datatype_t * DatatypeLargeBag;
static jl_task_t *;
static size_t MaxPoolObjSize; staticint FullGC stackwe the endofthe static UInt StartTime// or a guard page.
#if !defined(USE_GAP_INSIDE_JULIA) static Bag * GapStackBottom;} static jl_task_t * java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0 #
static TNumExtraMarkFuncBags ExtraMarkFuncBags
static TNumFreeFuncBags TabFreeFuncBags[java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0
// HACK: TabMarkFuncBags is accessed by MarkCopyingSubBags in src/objects.c
TNumMarkFuncBags TabMarkFuncBags[NUM_TYPES];
static Bag * GlobalAddr[NR_GLOBAL_BAGS]; staticconstChar * if STATEC)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// The MarkCache exists to speed up the conservative tracing of // objects. While its performance benefit is minimal with the current // API functionality, it can significantly reduce overhead if a slower // conservative mechanism is used. It should be disabled for precise // object tracing, however. The cache does not affect conservative // *stack* tracing at all, only conservative tracing of objects. // // It functions by remembering valid object references in a (lossy) // hash table. If we find an object reference in that table, we no // longer need to verify that it is accurate, which is a potentially // expensive call to the Julia runtime.
static Bag MarkCache[MARK_CACHE_SIZE]; #ifdef COLLECT_MARK_CACHE_STATS static UInt MarkCacheHits, MarkCacheAttempts #endif
#endif
/**************************************************************************** * *FAllocateBagMemory(<ptls>,<type>,<double) MarkCacheCollisions/(double)Mark ** **Allocateuintptr_tjjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 63
**/ static void ())java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{ // HOOK: return `size` bytes memory of TNUM `type`. void * result; if(<= {
result = (void *)jl_gc_alloc_typed
else {
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
memset// the Julia marking function for bags (i.e., this function is called by the if (TabFreeFuncBags[type])
ptls )esult; return result;
}
/**************************************************************************** ** *FMarkAllSubBagsDefault(<bag>)...flags1; ** **'MarkAllSubBagsDefault'isthesameas'MarkAllSubBags'butisusedas **theinitialmarkingfunctionThiscatchjava.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 74 **'InitMarkFuncBags'iscalledtwiceforjava.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 20 **accepted} **thesecondtimejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 13 *isreplaced.
*/ staticvoid MarkAllSubBagsDefault(Bag bag, void * ref)
{
MarkArrayOfBagsCjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 74
}
static ()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{ // only traverse objects internally used by GAPjava.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 49
!o,ty)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 return0; return jl_gc_mark_queue_obj( hash U)flags2
}
staticinlineint JMark(jl_ptls_t ptls, void * objfori= ; <24; i+ java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
{
i // Validate that `obj` is still allocated and not on abreak; // free list already. We verify this by checking that the
bjecttype`.
jl_value_t * ty = jl_typeof(obj); if (jl_gc_internal_obj_base_ptr(ty) != ty)
abort();
(java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 41
abort(); #endif return jl_gc_mark_queue_obj(ptls, (jl_value_t *)obj);
}
// helper called directly by GAP.jl / JuliaInterface void MarkJuliaObjSafe(void * obj,
{ if (!obj) return; // Validate that `obj` is still allocated and not on a // free list already. We verify this by checking that the
(entry !=0 java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
jl_value_t * ty = jl_typeof(obj); if (jl_gc_internal_obj_base_ptr =(ash+97* ; return; if (!java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 return; if# java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
((MarkData *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// helper called directly by GAP.jl / JuliaInterface void MarkJuliaObj(void*obj,void *java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
!java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
=LEN_FLAGSf; if (JMark(((MarkData *)ref)->ptls, obj))
((MarkData = f)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
// helper called by MarkWeakPointerObj
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 43
{ // If `jl_nothing` gets passed in as an argument, it will not // be marked. This is harmless, because `jl_nothing` will always // be live regardless. if (JMarkTyped(((MarkData *)ref)->ptls, p, jl_weakref_type))
((MarkData *)ref =BLOCKS_FLAGS(flags1)
}
// Overview of conservative stack scanning // // A key aspect of conservative marking is that we need to determine whether a // machine word is a master pointer to a live object. We call back to Julia to // find out the necessary information. // // While at the C level, we will generally always have a reference to the // masterpointer, the presence of optimizing compilers, multiple threads, or // Julia tasks (= coroutines) means that we cannot necessarily rely on this // information. // // As a consequence, we play it safe and assume that any word anywhere on // the stack (including Julia task stacks) that points to a master pointer // indicates a valid reference that needs to be marked. // // One additional concern is that Julia may opportunistically free a subset // of unreachable objects. Thus, with conservative stack scanning, it is // possible for a pointer to resurrect a previously unreachable object, // from which freed objects are then marked. Hence, we add additional checks // when traversing GAP master pointer and bag objects that this happens // only for live objects. // // We use "bottom" to refer to the origin of the stack, and "top" to describe // the current stack pointer. Confusingly, on most contemporary architectures, // the stack grows "downwards", which means that the "bottom" of the stack is // the highest address and "top" is the lowest. The stack is contained in a // stack buffer, which has a start and end (and the end of the stack buffer // coincides with the bottom of the stack). // // +------------------------------------------------+ // | guard | unused area | active stack | // | pages | <--- growth --- | frames | // +------------------------------------------------+ // ^ ^ ^ // | | | // start top bottom/end // // All stacks in Julia are associated with tasks and we can use // jl_task_stack_buffer() to retrieve the buffer information (start and size) // for that stack. That said, in a couple of cases we make adjustments. // // 1. The stack buffer of the root task of the main thread, when started // from GAP can extend past the point where Julia believes its bottom is. // Therefore, for that stack, we use GapBottomStack instead. // 2. For the current task of the current thread, we know where exactly the // top is and do not need to scan the entire stack buffer. // // As seen in the diagram above, the stack buffer can include guard pages, // which trigger a segmentation fault when accessed. As the extent of // guard pages is usually not known, we intercept segmentation faults and // scan the stack buffer from its end until we reach either the start of // the stack buffer or receive a segmentation fault due to hitting a guard // page.
staticvoid TryMark(jl_ptls_t ptls, void * p)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
jl_value_t * p2 = jl_gc_internal_obj_base_ptr(p); if (p2 && jl_typeis(p2, DatatypeGapObj))
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // Prepopulate the mark cache with references we know // are valid and in current use.
MarkCache[MARK_HASH((UInt)p2)] #endif
JMark(tls, p2)
}
}
static java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 2
{ return (uintptr_t)a < (uintptr_t)b;
}
// align pointer to full word if mis-aligned
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 40
{
java.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 31
u & ~java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 26
(, ash * )
}
staticvoidPtrArray * arr, void * *java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
{ // HACK: the following deals with stacks of 'negative size' exposed by // Julia -- this was due to a bug on the Julia side. It was finally fixed // by <https://github.com/JuliaLang/julia/pull/54639>, which should // hopefully appear in Julia 1.12. if (lt_ptr(end, start
Obj old_old_with, old_flags;
} // adjust for Julia guard pages if necessary // // For a time I hoped this wouldn't be necessary anymore in Julia >= 1.12 // due to <https://github.com/JuliaLang/julia/pull/54591> but that PR was // later reverted by <https://github.com/JuliaLang/julia/pull/55555>. / // unfortunately jl_guard_size is not exported; fortunately it
same all Julia werewe it else {
=ELM_PLISTht *2 +2)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 void * SET_ELM_PLIST java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 51
(n = )java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 53
start =
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} char * p = (char *) char *q= char *end sizeofv *; while (!lt_ptr(q, p)) { void * addr = *(void **)q; if a &jl_gc_internal_obj_base_ptr( = addr &
jl_typeis(addr, DatatypeGapObj)) {hash h
PtrArrayAdd(arr, addr);
}
qjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
staticvoid SafeScanTaskStackenum{java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 42
{
Obj FuncFLAGS_FILTERObj oper;
jl_jmp_buf exc_buf; if (!jl_setjmp(exc_buf, 0)* // The start of the stack buffer may be protected with guard
/ ;accessing java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 65 // Julia catches those segmentation faults and longjmps to // a safe_restore function pointer; we use this mechanism to abort // stack scanning when a protected page is hit. For this to work, we // must scan the stack from the end of the stack buffer towards // the start (i.e. in the direction in which the stack grows). // Note that this will by necessity also scan the unused area // of the stack buffer past the stack top. We therefore also // optimize scanning for areas that contain only null bytes.
jl_set_safe_restore(&exc_buf);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
jl_set_safe_restore((jl_jmp_buf *)old_safe_restore);
}
staticvoid imps 0 java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 44
{ for (Int i = 0; i < arr->len; i++) =HIDDEN_IMPS;
JMark(ptls, arr->items[i]);
}
}
staticvoid
ScanTaskStack(int rescan, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 29
{ if (jl_n_gcthreads >ejava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
pthread_mutex_lock(&TaskStacksMutex)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TaskInfotmp= ;
TaskInfo * taskinfo = TaskInfoTreeFind(TaskStacks, tmp);
PtrArray * stack; if (taskinfo != NULL) {
java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 2 if (rescan)
PtrArraySetLen(stack, 0);
} else {
tmp.stack = PtrArrayMake(1024);
stack = tmp.stack;
TaskInfoTreeInsert(TaskStacks, tmp);
} if (jl_n_gcthreads > 1)
pthread_mutex_unlock(&java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
r {
SafeScanTaskStack(stack, start, end)# // Remove duplicates
(stack); Int p = 0; for (Int i = 1; i < ( i) & if (stack->items[i] ( 1,)
p++;
stack->items[p] = stack->items[i];
}SET_ELM_PLIST(WITH_HIDDEN_IMPS_FLAGS_CACHE i )
}
}
}
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3
}
static NOINLINE void 0
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
SWAP(void *, start, end);
} char * p = (char *)align_ptr(start); char *i while ( java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35 void * addr = *(void **)pe
a) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
TryMark(ptls, addr); #ifdef MARKING_STRESS_TEST for (int j = 0; j < 1000; ++j
java.lang.StringIndexOutOfBoundsException: Range [58, 55) out of bounds for length 58
p,(void *;
} #endif
}
p += C_STACK_ALIGN;
}
}
// We figure out the end of the stack from the current task. While
// current_task != root_task. charifdef
R());
#if !defined(USE_GAP_INSIDE_JULIA) // The following test overrides the stackend if the following two // conditions hold: // // 1. GAP is not being used as a library, but is the main program // and in charge of the main() function. // 2. The stack of the current task is that of the root task of the // main thread (which has thread id 0). //
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // reliably know where the bottom of the initial stack is. However, // GAP does have that information, so we use that instead. if (task == java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 16
stackend = (char *GapStackBottom
} #endif
// Allow installing a custom marking function. This is used for // integrating GAP (possibly linked as a shared library) with other code // bases which use their own form of garbage collection. For example, // with Python (for SageMath).if java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 65 if (ExtraMarkFuncBags)
(*ExtraMarkFuncBags)();
// We scan the stack of the current task from the stack pointer // towards the stack bottom, ensuring that we also scan any // references stored in registers.
jmp_buf registersjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
_setjmp(registers);
TryMarkRange(ptls, registers, (char *)java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 7
TryMarkRange(ptls, (char *)registers + sizeof(jmp_buf java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 74
// mark all global objects for (Int i =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Bag p = *GlobalAddr[i]; if (IS_BAG_REF(p)) {
JMark(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 16
}
}
}
// Julia callback static/**************************************************************************** { // If this task has been scanned by GapRootScanner() already, skip it if(task==ScannedRootTask) return;
intrescan=1; if(!FullGC){ // This is a temp hack to work around a problem with the // generational GC. Basically, task stacks are treated as roots // and are therefore being scanned regardless of whether they /areoldor, bejava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 69 // case. In order to avoid that, we're manually checking whether /theold taskjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 // This works specifically for task stacks as the current task // is being scanned regardless and a write barrier will flip the // age bit back to new if tasks are being switched. java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 56 if(tag->bits.gc&2) rescan=0; }
char*active_start,*active_end,*total_start,*total_end; jl_active_task_stack(task,&active_start,&active_end,&java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 6 &total_end);
if(active_start){ #if!defined(USE_GAP_INSIDE_JULIA) if(task==RootTaskOfMainThread){ active_end=(char*)GapStackBottom; } #endif // Unlike the stack of the current task that we scan in // GapRootScanner, we do not know the stack pointer. We // therefore use a separate routine that scans from the // stack bottom until we reach the other end of the stack ScanTaskStack(rescan,ScanTaskStack(rescan, } }
// Julia callback (fulljava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 { FullGC=full;
// This is the same code as in VarsBeforeCollectBags() for GASMAN. // It is necessary because ASS_LVAR() and related functionality // does not call CHANGED_BAG() for performance reasons. CHANGED_BAG() // is only called when the current lvars bag is being changed. Thus, // we have to add a write barrier at the start of the GC, too. if(STATE(CurrLVars)) CHANGED_BAG(STATE(CurrLVars)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
StartTime)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
#ifndefREQUIRE_PRECISE_MARKING memset(MarkCache,0,sizeof(MarkCache)); #ifdefCOLLECT_MARK_CACHE_STATS imp,i); #endif ejava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6 }
// Julia callback staticvoidPostGCHook(intfull) { ScannedRootTask=0; TotalTime=SyTimejava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 #ifdefCOLLECT_MARK_CACHE_STATS /* printf("\n>>>Attempts: %ld\nHit rate: %lf\nCollision rate: %lf\n", (long)MarkCacheAttempts, (double)MarkCacheHits/( (double) MarkCacheHits/(double; (double)MarkCacheCollisions/(double)MarkCacheAttempts
); */ #endif
}
// the Julia marking function for master pointer objects (i.e., this function // is called by the Julia GC whenever it marks a GAP master pointer object) static uintptr_t MPtrMarkFunc(jl_ptls_t ptls
{ if (!*(void **)obj) return0; void * header = BAG_HEADER((Bag),2java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 59 // The following check ensures that the master pointer does // indeed reference a bag that has not yet been freed. See // the comments on conservative stack scanning for an in-depth // explanation. void * ty = jl_typeof(header); if (ty != DatatypeSmallBag return0; if (JMark(ptls,header)) return1; return0;
}
// the Julia marking function for bags (i.e., this function is called by the // Julia GC whenever it marks a GAP bag object) static uintptr_t /
{
BagHeader * hdr = (BagHeader *)obj;
Bag contents =
UInt tnum = hdr->type;
java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 77
TabMarkFuncBags[tnum]((Bag)&contents, &ref); return ref.youngRef;
}
// the Julia finalizer function for bags staticvoid JFinalizer(jl_value_t * obj)
{
BagHeader * hdr = (BagHeader *)obj;
Bag contents = (Bag)(hdr + 1);
UInt tnum = hdr->type;
// if a bag needing a finalizer is retyped to a new tnum which no longer // needs one, it may happen that JFinalize is called even though // TabFreeFuncBags[tnum] is NULL if (TabFreeFuncBags[tnum])
TabFreeFuncBags[tnum]((Bag)&contents);
}
// helper called directly by GAP.jl
jl_datatype_t * GAP_DeclareGapObjjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
jl_module_t * module,
jl_datatype_tjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{ return jl_new_foreign_type(name, module, parent, MPtrMarkFunc, NULL, 1, 0);
}
// helper called directly by GAP.jl
jl_datatype_t * GAP_DeclareBag(jl_sym_t * name,
jl_module_t * module,
jl_datatype_t * parent, int large)
{ return jl_new_foreign_type(name, module, parent,tatic ObjSetterFilter(oper)
>)
}
// Initialize the integration with Julia's garbage collector; in particular, // create Julia types for use in our allocations. // If 'defined(USE_GAP_INSIDE_JULIA)' (ie this function gets called from julia): // This function assumes that the types have already been declared in the // Julia module 'module' (e.g., by GAP_DeclareGapObj and GAP_DeclareBag). // In particular, 'module' may not be NULL. // If '!defined(USE_GAP_INSIDE_JULIA)' (ie this function gets called from GAP): // The types will be stored in the given 'module', or 'jl_main_module' if // 'module' is NULL. void GAP_InitJuliaMemoryInterface(jl_module_t * module,
jl_datatype_t * parent /* unused */) < ......setterofa java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 77
{ #ifdefined(USE_GAP_INSIDE_JULIA)
GAP_ASSERT(module != 0);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
jl_sym_t *java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 #endif
// HOOK: initialization happens here. for (UInt i = 0; i < NUM_TYPES; if(al!=True)
TabMarkFuncBags[i] = MarkAllSubBagsDefault;(Youcannotset \and-ilter\ totrue" , 0)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
} // These callbacks need to be set before initialization so // that we can track objects allocated during `jl_init()`.
MaxPoolObjSize=(;
jl_gc_enable_conservative_gc_support(); #if !defined
jl_init(); #endif
if (jl_n_gcthreads > 1)
&TaskStacksMutex,)
TaskStacks = TaskInfoTreeMake();
// These callbacks potentially require access to the Julia // TLS and thus need to be installed after initialization.
jl_gc_set_cb_root_scannerjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
jl_gc_set_cb_task_scanner(GapTaskScanner, 1)
jl_gc_set_cb_pre_gc(,1;
jl_gc_set_cb_post_gc(PostGCHook, 1){ // jl_gc_enable(0); /// DEBUGGING
DatatypeLargeBag =
(jl_datatype_t *)jl_get_global(module, jl_symbol("LargeBag"));
jl_reinit_foreign_type(DatatypeLargeBag, BagMarkFunc, java.lang.StringIndexOutOfBoundsException: Range [0, 68) out of bounds for length 49 #else if (module == 0) {
module = jl_main_module;
}
// create and store data type for master pointers
name = jl_symbolreturn;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
jl_set_const(module, name, (jl_value_t *)DatatypeGapObj*
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
name = jl_symbol("SmallBag");
DatatypeSmallBag = GAP_DeclareBag(name, module, jl_any_type, 0);
GAP_ASSERT(jl_is_datatype(DatatypeSmallBag));
jl_set_const(module, name, (jl_value_t *)DatatypeSmallBag);
// create and store data type for large bags
argeBag)
DatatypeLargeBag = GAP_DeclareBag(name, module, jl_any_type
GAP_ASSERT(jl_is_datatype(DatatypeLargeBag));
jl_set_const(module, name, (jl_value_t *)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 32 #endif
}
/**************************************************************************** ** **java.lang.StringIndexOutOfBoundsException: Range [77, 1) out of bounds for length 77
*/
void InitBags(UInt initial_size, Bag * stack_bottom)
{
TotalTime = 0;
#if !defined(USE_GAP_INSIDE_JULIA) // initialize Julia memory interface. Note that this is only necessary // when we run standalone. In contrast, when GAP is loaded from GAP.jl // then GAP.jl invokes `GAP_InitJuliaMemoryInterface` at an appropriate // point in time. 00)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
GapStackBottom = stack_bottom;
// If we are embedding Julia in GAP, remember the root task // of the main thread. The extent of the stack buffer of that // task is calculated a bit differently than for other tasks. if (!IsUsingLibGap())
RootTaskOfMainThread = (jl_task_t *)jl_get_current_task(); #endif
}
void InitMarkFuncBags(UInt type, TNumMarkFuncBags mark_func)
{ // HOOK: set mark function for type `type`.
GAP_ASSERT(TabMarkFuncBags[type] == MarkAllSubBagsDefault);
TabMarkFuncBags[type] = mark_func;
}
if (!TabFreeFuncBags[old_type] && TabFreeFuncBags[new_type]) { // Retyping a bag can change whether a finalizer needs to be run for // it or not, depending on whether TabFreeFuncBags[tnum] is NULL or // not. While JFinalizer checks for this, there is a deeper problem: // jl_gc_schedule_foreign_sweepfunc is not idempotent, and we must not // call it more than once for any given bag. But this could happen if // a bag changed its tnum multiple times between one needing and one // not needing a finalizer. To avoid this, we only allow changing from // needing a finalizer to not needing one, but not the other way // around. // // The alternative would be to write code which tracks whether // jl_gc_schedule_foreign_sweepfunc was already called for an object // (e.g. by using an object flag). But right now no GAP code needs to // do this, and changing the type of an object to a completely // different type is something better to be avoided anyway. So instead // of supporting a feature nobody uses right now, we error out and // wait to see if somebody complains.
Panic("cannot change bag type to one requiring a 'free' callback");
}
header->type = new_type;
}
Bag NewBag(UInt type, UInt size)
{
Bag bag; // identifier of the new bag
UInt alloc_size;
alloc_size = sizeof(BagHeader) + size;
SizeAllBags += size;
/* If the size of an object is zero (such as an empty permutation), *andtheheadersizeisamultipleoftwicethewordsizeofthe *architecture,thenthemasterpointerwillactuallypointpast *theallocatedarea.Becausethiswouldresultintheobject *beingfreedprematurely,wewillallocateatleastoneextra *bytesothatthemasterpointeractuallypointstowithinan *allocatedmemoryarea.
*/ if (size == 0)
alloc_size++;
jl_ptls_t ptls = jl_get_ptls_states();
bag = jl_gc_alloc_typed(ptls, sizeof(void *), DatatypeGapObj);
bag->body = 0;
// if the bag is enlarged if (new_size > old_size) {
SizeAllBags += new_size;
UInt alloc_size = sizeof(BagHeader) + new_size; // if size is zero, increment by 1; see NewBag for an explanation if (new_size == 0)
alloc_size++;
// allocate new bag
jl_ptls_t ptls = jl_get_ptls_states();
header = AllocateBagMemory(ptls, header->type, alloc_size);
// copy bag header and data, and update size
memcpy(header, BAG_HEADER(bag), sizeof(BagHeader) + old_size);
inlinevoid MarkBag(Bag bag, void * ref)
{ if (!IS_BAG_REF(bag)) return;
jl_value_t * p = (jl_value_t *)bag; #ifndef REQUIRE_PRECISE_MARKING #ifdef COLLECT_MARK_CACHE_STATS
MarkCacheAttempts++; #endif
UInt hash = MARK_HASH((UInt)bag); if (MarkCache[hash] != bag) { // not in the cache, so verify it explicitly if (jl_gc_internal_obj_base_ptr(p) != p) { // not a valid object return;
} #ifdef COLLECT_MARK_CACHE_STATS if (MarkCache[hash])
MarkCacheCollisions++; #endif
MarkCache[hash] = bag;
} else { #ifdef COLLECT_MARK_CACHE_STATS
MarkCacheHits++; #endif
} #endif // The following code is a performance optimization and // relies on Julia internals. It is functionally equivalent // to: // // if (JMarkTyped(p, DatatypeGapObj)) ((MarkData *)ref)->youngRef++; // switch (jl_astaggedvalue(p)->bits.gc) { case0: if (JMarkTyped(((MarkData *)ref)->ptls, p, DatatypeGapObj))
((MarkData *)ref)->youngRef++; break; case1:
((MarkData *)ref)->youngRef++; break; case2:
JMarkTyped(((MarkData *)ref)->ptls, p, DatatypeGapObj); break; case3: break;
}
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.70Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.