English 中文(简体)
什么可以导致小鼠开始记忆?
原标题:What could cause malloc to initialise memory?

我写的是使用一个称为SCIP的图书馆(溶胶成问题)。 图书馆本身可以两种方式汇编:制作一套文件,然后是双向文件,制作一套共有物体。 在这两种情况下,《公约》都与《公约》本身,相当庞大,是《马克茨》。

我有两处执行,一是编集了......a 文档(我称该方案1),另一处是同共有物体的联系(我称该方案2)。 方案1使用一个由独立会计师协会提供的文件汇编,而方案2则使用我自己的、更简单的文件汇编。

我所写的法典中,Im碰到的行为在《保护儿童和青少年法》中发生。 法典摘要如下:

void* BMSallocMemory_call(size_t size)  
{  
   void* ptr;  

   size = MAX(size, 1);  
   ptr = malloc(size);  

   // This is where I call gdb print statements.  

   if( ptr == NULL )  
   {  
      printf("ERROR - unable to allocate memory for a SCIP*.
");  
   }  
   return ptr;  
}

void SCIPcreate(SCIP** A)  
{  
   *A = (SCIP*)BMSallocMemory_call(sizeof(**(A)))  
   .  
   .  
   .  
}  

如果我把这部守则放在格德布,并通过<条码>调用,<>,以便了解情况,并查看<条码>*(SCIP*(ptr))的内容,我获得以下产出:

方案1gdb产出:

289    size = MAX(size, 1);  
(gdb) step  
284 {  
(gdb)   
289    size = MAX(size, 1);  
(gdb)   
290    ptr = malloc(size);  
(gdb) print ptr  
$1 = <value optimised out>  
(gdb) step  
292    if( ptr == NULL )  
(gdb) print ptr  
$2 = <value optimised out>  
(gdb) step  
290    ptr = malloc(size);  
(gdb) print ptr  
$3 = (void *) 0x8338448  
(gdb) print *((SCIP*)(ptr))  
$4 = {mem = 0x0, set = 0x0, interrupt = 0x0, dialoghdlr = 0x0, totaltime = 0x0, stat = 0x0, origprob = 0x0, eventfilter = 0x0, eventqueue = 0x0, branchcand = 0x0, lp = 0x0, nlp = 0x0, relaxation = 0x0, primal = 0x0, tree = 0x0, conflict = 0x0, cliquetable = 0x0, transprob = 0x0, pricestore = 0x0, sepastore = 0x0, cutpool = 0x0}  

方案2

289    size = MAX(size, 1);  
(gdb) step  
290    ptr = malloc(size);  
(gdb) print ptr  
$1 = (void *) 0xb7fe450c  
(gdb) print *((SCIP*)(ptr))  
$2 = {mem = 0x1, set = 0x8232360, interrupt = 0x1, dialoghdlr = 0xb7faa6f8, totaltime = 0x0, stat = 0xb7fe45a0, origprob = 0xb7fe4480, eventfilter = 0xfffffffd, eventqueue = 0x1, branchcand = 0x826e6a0, lp = 0x8229c20, nlp = 0xb7fdde80, relaxation = 0x822a0d0, primal = 0xb7f77d20, tree = 0xb7fd0f20, conflict = 0xfffffffd, cliquetable = 0x1, transprob = 0x8232360, pricestore = 0x1, sepastore = 0x822e0b8, cutpool = 0x0}  

我认为的唯一原因是,无论是在方案1中,还是在方案1中,都有某种选择,迫使小鼠开始记忆。 我必须了解,为什么这一结构是在汇编的执行过程中启动的,而不是在共同的目标执行中。

问题回答

我怀疑这两个方案是如何建设的。

http://www.ohchr.org。 可能发生这种情况的是,你回来的记忆充斥着零。 例如,一个刚刚启动的方案比一个同时进行并分配/分配记忆的方案更有可能从<条码>小型获得零填充的记忆。

<><>>> 您可以发现以下过去感兴趣的问题:

小规模记忆的启动可能取决于执行。 由于业绩原因,执行工作是免费的,但可以开始记忆,例如 de。

还有一点值得注意。 即便是未开始的记忆也可能包含零。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签