小编0x9*_*x90的帖子

valgrind输出中的数字是什么意思?

我有来自valgrind的输出:

==4836== 10,232 bytes in 1 blocks are still reachable in loss record 1 of 1
==4836==    at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4836==    by 0x401865: thrt() (main.cpp:221)
==4836==    by 0x4048B1: main (tester.cpp:35)
Run Code Online (Sandbox Code Playgroud)

我有两个问题:

  • 什么==4836==意思?
  • 什么0x4C2779D意思?

c c++ valgrind

2
推荐指数
1
解决办法
244
查看次数

什么是`.`和`*`在ac宏中意味着什么?

这里是什么.,并*在交流宏意味着什么?

583 #define INITCALLS                                                       \
584         *(.initcallearly.init)                                          \
585         VMLINUX_SYMBOL(__early_initcall_end) = .;                       \
586         *(.initcall0.init)                                              \
587         *(.initcall0s.init)                                             \
588         *(.initcall1.init)                                              \
589         *(.initcall1s.init)                                             \
590         *(.initcall2.init)                                              \
591         *(.initcall2s.init)                                             \
592         *(.initcall3.init)                                              \
593         *(.initcall3s.init)                                             \
594         *(.initcall4.init)                                              \
595         *(.initcall4s.init)                                             \
596         *(.initcall5.init)                                              \
597         *(.initcall5s.init)                                             \
598         *(.initcallrootfs.init)                                         \
599         *(.initcall6.init)                                              \
600         *(.initcall6s.init)                                             \
601         *(.initcall7.init)                                              \
602         *(.initcall7s.init)
603 
Run Code Online (Sandbox Code Playgroud)

c linux macros kernel ld

2
推荐指数
1
解决办法
170
查看次数

shell代码脚本将stderr重定向到stdout(2>&1)是什么意思?

我知道,这2>&1使您可以重定向stderr到任何地方stdout.

  • 但是&这个shell代码意味着什么?是不是附加运营商?
  • 是否可以将所有描述符流式传输到stdout?

linux shell stdout stderr

2
推荐指数
1
解决办法
561
查看次数

为什么我的 http POST 请求不顺利?

我正在尝试在 ruby​​ 中发出此POST 请求。但回来 #<Net::HTTPUnsupportedMediaType:0x007f94d396bb98>我尝试的是:

require 'rubygems'
require 'net/http'
require 'uri'
require 'json'

auto_index_nodes =URI('http://localhost:7474/db/data/index/node/')

request_nodes = Net::HTTP::Post.new(auto_index_nodes.request_uri)
http = Net::HTTP.new(auto_index_nodes.host, auto_index_nodes.port)

request_nodes.add_field("Accept", "application/json")

request_nodes.set_form_data({"name"=>"node_auto_index",
                            "config" => {
                            "type" => "fulltext",
                            "provider" =>"lucene"} ,
                            "Content-Type" => "application/json"
                            })


response = http.request(request_nodes)
Run Code Online (Sandbox Code Playgroud)

尝试写这部分:

"config" => {
             "type" => "fulltext",
             provider" =>"lucene"} ,
             "Content-Type" => "application/json"
            }
Run Code Online (Sandbox Code Playgroud)

像那样:

"config" => '{
              "type" => "fulltext",\
              "provider" =>"lucene"},\
              "Content-Type" => "application/json"\
              }'
Run Code Online (Sandbox Code Playgroud)

这次尝试也没有帮助:

request_nodes.set_form_data({"name"=>"node_auto_index",
                            "config" => '{ \
                            "type" : "fulltext",\ …
Run Code Online (Sandbox Code Playgroud)

ruby post neo4j

2
推荐指数
1
解决办法
763
查看次数

为什么我们只能直接访问PCI物理地址中的640k-1MB区域?

http://www.mjmwired.net/kernel/Documentation/IO-mapping.txt

153  - remapping and writing:
154     /*
155      * remap framebuffer PCI memory area at 0xFC000000,
156      * size 1MB, so that we can access it: We can directly
157      * access only the 640k-1MB area, so anything else
158      * has to be remapped.
159      */
160     void __iomem *baseptr = ioremap(0xFC000000, 1024*1024);
161 
162     /* write a 'A' to the offset 10 of the area */
163     writeb('A',baseptr+10);
164 
165     /* unmap when we unload the driver …
Run Code Online (Sandbox Code Playgroud)

c linux kernel linux-kernel ioremap

2
推荐指数
1
解决办法
391
查看次数

使用浮动和双倍时,c中的-0.0000是多少?

#include <stdio.h>
#include <stdlib.h>

#define answer 3.141593

void main(int argc, char **argv) {

        float a = (argc - 2)?: strtod(argv[1], 0);    
        printf("double = %lf ,float =  %f", a-answer , a-answer);

}
Run Code Online (Sandbox Code Playgroud)

当我这样运行时:

./a.out 3.141593
Run Code Online (Sandbox Code Playgroud)

输出是

double = -0.000000 ,float =  -0.000000
Run Code Online (Sandbox Code Playgroud)

为什么呢-0.00000?我怎样才能输出0.000000

我怎么做a == answer


如果使用2的补码,怎么会有-0值?

c floating-point double gcc

2
推荐指数
1
解决办法
1476
查看次数

C++*new和new之间的区别

这个问题可能是重复的.我一直在网上寻找这个想法,但我找不到任何东西.'new'和'*new'有什么区别?:

int main()
{
    class Cat
    {
        //Code
    }

    new Cat();
    *new Cat();

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ pointers object

2
推荐指数
3
解决办法
444
查看次数

从.so调用符号

我有一个.so库,并运行nm -gC它.

我看到这样的输出:

0011a011 W void my_fun< unsigned char>(unsigned char*, unsigned char, int)
Run Code Online (Sandbox Code Playgroud)

我可以包含的标头都不包含此功能,但我想从我的cpp文件中调用它.

我该怎么做呢?

c++ linux shared-libraries

2
推荐指数
1
解决办法
127
查看次数

为什么(1)["abcd"] +"efg" - 'b'+ 1变成"fg"?

#include <stdio.h>
int main()
{
    printf("%s", (1)["abcd"]+"efg"-'b'+1);
}
Run Code Online (Sandbox Code Playgroud)

有人可以解释为什么这段代码的输出是:

fg
Run Code Online (Sandbox Code Playgroud)

我知道(1)["abcd"]点,"bcd"但为什么+"efg"-'b'+1甚至是一个有效的语法?

c printf char

2
推荐指数
1
解决办法
228
查看次数

了解设备树机制

正在阅读设备树用法ranges并到达描述节点关键属性的部分。

external-bus {
        #address-cells = <2>
        #size-cells = <1>;
        ranges = <0 0  0x10100000   0x10000     // Chipselect 1, Ethernet
                  1 0  0x10160000   0x10000     // Chipselect 2, i2c controller
                  2 0  0x30000000   0x1000000>; // Chipselect 3, NOR Flash

        ethernet@0,0 {
            compatible = "smc,smc91c111";
            reg = <0 0 0x1000>;
            interrupts = < 5 2 >;
        };

        i2c@1,0 {
            compatible = "acme,a1234-i2c-bus";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <1 0 0x1000>;
            interrupts = < 6 2 >;
            rtc@58 …
Run Code Online (Sandbox Code Playgroud)

linux kernel device device-tree

2
推荐指数
1
解决办法
8178
查看次数