69,382
社区成员
发帖
与我相关
我的任务
分享
# 418 "/usr/include/stdio.h" 3 4
extern int __isthreaded;
# 452 "/usr/include/stdio.h" 3 4
# 2 "051.c" 2
static char memp_memory[4 - 1
# 1 "memp_std.h" 1
+ ((16) * (16 + (((1024) + 3) / 4 * 4)))
# 10 "051.c" 2
];
int
main(int argc, char *argv[])
{
(void)printf("%d\n", (int)sizeof(memp_memory));
return 0;
}
static char memp_memory[4 - 1
+ ((16) * (16 + (((1024) + 3) / 4 * 4)))
];
#include <stdio.h>
#define MEMP_SIZE 16
#define MEMP_ALIGN_SIZE(x) (((x) + 3) / 4 * 4)
#define MEM_ALIGNMENT 4
static char memp_memory[MEM_ALIGNMENT - 1
#define MEMPOOL(name,num,size,desc) + ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))
#include "memp_std.h"
];
int
main(int argc, char *argv[])
{
(void)printf("%d\n", (int)sizeof(memp_memory));
return 0;
}
/*
* memp_std.h
*/
#ifndef MEMP_STD_H
#define MEMP_STD_H
MEMPOOL("mymtom", 16, 1024, "")
#endif /* MEMP_STD_H */
#include <stdio.h>
#define MEM_ALIGNMENT 10
static char memp_memory[MEM_ALIGNMENT - 1
#define MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) )
#include "stdio.h"
];
int main(void)
{
printf("%d\n",sizeof(memp_memory));
}