mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
use macro for replace malloc api (see skynet_malloc.h)
This commit is contained in:
@@ -586,14 +586,14 @@ harbor_init(struct harbor *h, struct skynet_context *ctx, const char * args) {
|
||||
char local_addr[sz];
|
||||
int harbor_id = 0;
|
||||
sscanf(args,"%s %s %d",master_addr, local_addr, &harbor_id);
|
||||
h->master_addr = strdup(master_addr);
|
||||
h->master_addr = skynet_strdup(master_addr);
|
||||
h->id = harbor_id;
|
||||
h->master_fd = _connect_to(h, master_addr, true);
|
||||
if (h->master_fd == -1) {
|
||||
fprintf(stderr, "Harbor: Connect to master failed\n");
|
||||
exit(1);
|
||||
}
|
||||
h->local_addr = strdup(local_addr);
|
||||
h->local_addr = skynet_strdup(local_addr);
|
||||
|
||||
_launch_gate(ctx, local_addr);
|
||||
skynet_callback(ctx, h, _mainloop);
|
||||
|
||||
@@ -267,7 +267,7 @@ struct snlua *
|
||||
snlua_create(void) {
|
||||
struct snlua * l = malloc(sizeof(*l));
|
||||
memset(l,0,sizeof(*l));
|
||||
l->L = luaL_newstate();
|
||||
l->L = lua_newstate(skynet_lalloc, NULL);
|
||||
l->init = _init;
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user