Przemyslaw, I'm not completely sure I do understand the way the pre-loading of the stack gets done, but I think it ends up in creating a variable in every C function which needs access to the stack.
Now, int f() { HB_STACK_TLS_PRELOAD } becomes (more or less) int f() { PULONG hb_stack_ptr = hb_tls_get( hb_stack_key ); } where hb_stack_key is an index in win32 but the real memory address in OS/2. So, when in win32 you call TlsGetValue( hb_stack_key ) you ask for the content of that slot of memory, but when you call DosAllocThreadLocalMemory( 1, &k ), 1 means you need a single DWORD, &k will contain the address of that DWORD which is local to your thread. So, when every function calls hb_tls_get() in OS/2, you simply get back what you passed to it, which is not the original pointer you got with DosAllocThreadLocalMemory() since the first call did not save it somewhere. Maybe I'm just confused by too many macros and I'm simply missing the real way in which this should work, but after a few hours looking at this problem I cannot understand what is not working. Can you please confirm what I've said or explain to me how pre-loading is intended to work? Maurilio. Przemyslaw Czerpak wrote: > I rechecked them again and I do not see anything wrong in this modifications. > In fact there were two modifications related to OS2: TLS buffering and > DTCPV40HDRS macro in default builds. Please try to disable them selectively. > You can disable TLS buffering by commenting the line with: > #define HB_STACK_PRELOAD > at the beginning of estack.c. If it does not help then do the same > in hvm.c. Finally try to not use DTCPV40HDRS. > I have no more ideas what could be the problem. > > best regards and thanks for your help. > Przemek > _______________________________________________ > Harbour mailing list > Harbour@harbour-project.org > http://lists.harbour-project.org/mailman/listinfo/harbour > -- __________ | | | |__| Maurilio Longo |_|_|_|____| farmaconsult s.r.l. _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour