function registerTools() {
extractors = fs.readdirSync(extractorPath).filter(function(extractor) {
return extractor !== "temp";
});
totalExtractors = extractors.length;
extractors.map(function(item) {
var fullExtractorPath = path.join(extractorPath, item);
return require(fullExtractorPath);
}).forEach(function(extractor) {
if (extractor.test) {
testExtractor(extractor);
} else {
satisfiedExtractors++;
registerExtractor(extractor);
}
});
}
var registerExtractor = function(extractor) {
if (extractor.extensions) {
extractor.extensions.forEach(function(ext) {
extensionExtractors[ext] = extractor.extract;
});
}
};
以上两个代码段返回不同的输出,
Case I:
int a[12];
printf("%d",sizeof(a));
Case II:
int *a = (int *)malloc(12*sizeof(int));
printf("%d",sizeof(a));
48
在第二种情况下为什么会这样?