Commit ed26fa89f926fb067578ac54ad916b07d5404777

Authored by David René
1 parent e4a79859

try to fix Allocator issue

anubis_dev/vm/SConstruct
... ... @@ -153,7 +153,7 @@ main_src = [os.path.join('build', x) for x in Split("""
153 153 vmint.cpp vmalloc.cpp vm.cpp vmtools.cpp graphics.cpp sslstuff.cpp time.c
154 154 AnubisAllocator.cpp AnubisFileLocker.cpp AnubisProcess.cpp
155 155 syscall.cpp syscall32.cpp serialize.cpp Profiling.cpp debugger.cpp Library.cpp
156   - dynamic_module.c
  156 + dynamic_module.cpp
157 157 """)]
158 158 if sqlapi:
159 159 main_src.append(os.path.join('build', 'dbapi_tools.cpp'))
... ...
anubis_dev/vm/src/dynamic_module.c renamed to anubis_dev/vm/src/dynamic_module.cpp
... ... @@ -394,6 +394,7 @@
394 394 #include "vm.h"
395 395 #include "bytecode.h"
396 396 #include "AnubisProcess.h"
  397 +#include "AnubisAllocator.h"
397 398  
398 399  
399 400 /***************************************************
... ... @@ -432,7 +433,7 @@ U32 number_of_module_slots = 0; /* total number
432 433  
433 434 */
434 435 int /* 0 = out of memory, 1 = ok */
435   - resize_modules_array(void)
  436 + resize_modules_array(AnubisAllocator *allocator)
436 437 {
437 438 if (number_of_modules == number_of_module_slots)
438 439 {
... ... @@ -561,7 +562,7 @@ int /* 0 = out of memory, 1 = ok */
561 562  
562 563 /*** Removing a module from the array. *************************************************/
563 564 void
564   - remove_module(int index)
  565 + remove_module(int index, AnubisAllocator *allocator)
565 566 {
566 567 /* Inform if required */
567 568 if (show_module_loading) printf("Unloading module %d\n",index);
... ... @@ -591,7 +592,7 @@ void vcopy_module_ref(U8 *ref)
591 592 }
592 593  
593 594 /*** Make a virtual deletion of a reference within a module. ************************************/
594   -void vdelete_module_ref(U8 *ref)
  595 +void vdelete_module_ref(U8 *ref, AnubisAllocator *allocator)
595 596 {
596 597 int index = find_module_index(ref);
597 598 if ((modules[index].flags)&mf_secondary_adm) /* don't do anything for primary module */
... ... @@ -599,7 +600,7 @@ void vdelete_module_ref(U8 *ref)
599 600 (*((U32 *)((modules[index].byte_code)-8)))--; /* decrement counter of module */
600 601 if (!(*((U32 *)((modules[index].byte_code)-8)))) /* if down to 0 */
601 602 {
602   - remove_module(index);
  603 + remove_module(index, allocator);
603 604 }
604 605 }
605 606 }
... ...