mirror of
https://github.com/mirror/make.git
synced 2026-08-13 17:07:13 +00:00
Add memory allocation cleanup to loadable objects.
Add gmk_alloc() and gmk_free() functions so loadable objects can access our memory model. Also provide a more extensive example in the manual.
This commit is contained in:
@@ -36,13 +36,17 @@ test_expand (const char *val)
|
||||
static char *
|
||||
func_test (const char *funcname, int argc, char **argv)
|
||||
{
|
||||
char *mem;
|
||||
|
||||
if (strcmp (funcname, "test-expand") == 0)
|
||||
return test_expand (argv[0]);
|
||||
|
||||
if (strcmp (funcname, "test-eval") == 0)
|
||||
return test_eval (argv[0]);
|
||||
|
||||
return strdup ("unknown");
|
||||
mem = gmk_alloc (strlen ("unknown") + 1);
|
||||
strcpy (mem, "unknown");
|
||||
return mem;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user