Changeset 22187 for v6

Show
Ignore:
Timestamp:
09/08/08 03:45:51 (3 months ago)
Author:
ruoso
Message:

[smop] array iterator almost working... the return of prefix:<=> needs to be better defined. re set SMOP_LOWLEVEL_MEM_TRACE in cmake and find out that the files .m0ld have many leaks...

Location:
v6/smop
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/CMakeLists.txt

    r22183 r22187  
    11project (smop) 
     2SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_TRACE" ) 
    23SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) 
    34cmake_minimum_required (VERSION 2.6) 
  • v6/smop/src/smop_s1p_array.c

    r22183 r22187  
    4242  if (new_size > array->size) { 
    4343    int old_size = array->size; 
    44     array->size = 1<<(floor_log2(new_size)); 
     44    array->size = new_size; // this looks buggy: 1<<(floor_log2(new_size)); 
    4545    //printf("new size:%d resizing to %d previous size:%d\n",new_size,array->size,old_size); 
    46     array->content = realloc(array->content,array->size); 
    47     int i;for (i=old_size;i<array->size;i++) array->content[i] = NULL; 
     46    array->content = realloc(array->content,(array->size * sizeof(void*))); 
     47    int i; 
     48    for ( i = old_size ; i < new_size ; i++) { 
     49      array->content[i] = NULL; 
     50    } 
    4851  } 
    4952}