From 21c58b8d4010c09406bd5bc3c2350830d42a4e46 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Mon, 28 Aug 2000 21:17:46 +0000 Subject: [PATCH] Document kobj_class_compile_static(). --- share/man/man9/Makefile | 1 + share/man/man9/kobj.9 | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index b9970cabdb5..d378f7c4137 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -110,6 +110,7 @@ MLINKS+=microuptime.9 getmicrouptime.9 microuptime.9 nanouptime.9 MLINKS+=microuptime.9 getnanouptime.9 MLINKS+=kobj.9 kobj_class_compile.9 +MLINKS+=kobj.9 kobj_class_compile_static.9 MLINKS+=kobj.9 kobj_class_free.9 MLINKS+=kobj.9 kobj_create.9 MLINKS+=kobj.9 kobj_init.9 diff --git a/share/man/man9/kobj.9 b/share/man/man9/kobj.9 index 5e6c2e7fafc..7f51d494f15 100644 --- a/share/man/man9/kobj.9 +++ b/share/man/man9/kobj.9 @@ -40,6 +40,8 @@ .Ft void .Fn kobj_class_compile "kobj_class_t cls" .Ft void +.Fn kobj_class_compile_static "kobj_class_t cls" "kobj_ops_t ops" +.Ft void .Fn kobj_class_free "kobj_class_t cls" .Ft kobj_t .Fn kobj_create "kobj_class_t cls" "struct malloc_type *mtype" "int mflags" @@ -96,13 +98,23 @@ The device framework uses this feature to associate drivers with devices. .Pp The functions -.Fn kobj_class_compile +.Fn kobj_class_compile , +.Fn kobj_class_compile_static and .Fn kobj_class_free are used to process a class description to make method dispatching efficient. A client should not normally need to call these since a class will automatically be compiled the first time it is used. +If a class is to be used before +.Xr malloc 9 +is initialised, +then +.Fn kobj_class_compile_static +should be called with the class and a pointer to a statically +allocated +.Dv kobj_ops +structure before the class is used to initialise any objects. .Pp To define a class, first define a simple array of .Dv kobj_method_t .