Extract the logic for creating void* type to type_get_voidptr
diff --git a/prototype.c b/prototype.c
index 92f7509..319b7a2 100644
--- a/prototype.c
+++ b/prototype.c
@@ -645,12 +645,10 @@
 init_global_config(void)
 {
 	protolib_init(&legacy_typedefs);
-	struct arg_type_info *void_info = type_get_simple(ARGTYPE_VOID);
-	static struct arg_type_info ptr_info;
-	type_init_pointer(&ptr_info, void_info, 0);
 
+	struct arg_type_info *ptr_info = type_get_voidptr();
 	static struct named_type voidptr_type;
-	named_type_init(&voidptr_type, &ptr_info, 0);
+	named_type_init(&voidptr_type, ptr_info, 0);
 
 	/* Build legacy typedefs first.  This is used by
 	 * protolib_cache_init call below.  */
diff --git a/type.c b/type.c
index 458da4b..6128085 100644
--- a/type.c
+++ b/type.c
@@ -59,6 +59,19 @@
 	abort();
 }
 
+struct arg_type_info *
+type_get_voidptr(void)
+{
+	struct arg_type_info *void_info = type_get_simple(ARGTYPE_VOID);
+	static struct arg_type_info *ret;
+	if (ret == NULL) {
+		static struct arg_type_info ptr_info;
+		type_init_pointer(&ptr_info, void_info, 0);
+		ret = &ptr_info;
+	}
+	return ret;
+}
+
 static void
 type_init_common(struct arg_type_info *info, enum arg_type type)
 {
diff --git a/type.h b/type.h
index 0ffbd98..9ddaa34 100644
--- a/type.h
+++ b/type.h
@@ -70,6 +70,7 @@
  * struct, or pointer.  Each call with the same TYPE yields the same
  * arg_type_info pointer.  */
 struct arg_type_info *type_get_simple(enum arg_type type);
+struct arg_type_info *type_get_voidptr(void);
 
 /* Initialize INFO so it becomes ARGTYPE_STRUCT.  The created
  * structure contains no fields.  Use type_struct_add to populate the