mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
use macro for replace malloc api (see skynet_malloc.h)
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// include skynet.h first for malloc hook
|
||||
#include "skynet.h"
|
||||
|
||||
#include "skynet_module.h"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -103,7 +106,7 @@ skynet_module_query(const char * name) {
|
||||
M->m[index].module = dl;
|
||||
|
||||
if (_open_sym(&M->m[index]) == 0) {
|
||||
M->m[index].name = strdup(name);
|
||||
M->m[index].name = skynet_strdup(name);
|
||||
M->count ++;
|
||||
result = &M->m[index];
|
||||
}
|
||||
@@ -152,7 +155,7 @@ void
|
||||
skynet_module_init(const char *path) {
|
||||
struct modules *m = malloc(sizeof(*m));
|
||||
m->count = 0;
|
||||
m->path = strdup(path);
|
||||
m->path = skynet_strdup(path);
|
||||
m->lock = 0;
|
||||
|
||||
M = m;
|
||||
|
||||
Reference in New Issue
Block a user