acl/lib_acl/samples/trace2/main.c
zsxxsz cf2528eb7c 完善了非阻塞IO的SSL功能;将 samples 移到 lib_acl 目录下
完善了非阻塞IO的SSL功能;将 acl/samples/ 下的示例分别移到 lib_acl 及 lib_protocol 目录下
2014-11-30 21:15:35 +08:00

36 lines
910 B
C

#include "lib_acl.h"
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
static void test_trace(void)
{
const char *s = "hello hello hello hello hello hello";
ACL_ARGV *argv = acl_argv_split(s, " ");
ACL_HTABLE *htable;
acl_argv_free(argv);
printf("-------------------------------------------------------\r\n");
acl_default_set_memlimit(100);
htable = acl_htable_create(100, 0);
acl_htable_enter(htable, "hello", acl_mystrdup(s));
acl_htable_free(htable, acl_myfree_fn);
printf("-------------------------------------------------------\r\n");
printf("addr: %p\r\n", __builtin_return_address (0));
printf("addr: %p\r\n", __builtin_return_address (1));
}
int main(void)
{
char *ptr = (char*) malloc(100);
size_t n = malloc_usable_size(ptr);
printf("n: %d\r\n", (int) n);
acl_msg_stdout_enable(1);
test_trace();
return (0);
}