mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-03 04:17:52 +08:00
cf2528eb7c
完善了非阻塞IO的SSL功能;将 acl/samples/ 下的示例分别移到 lib_acl 及 lib_protocol 目录下
36 lines
910 B
C
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);
|
|
}
|