Use doxygen to build docs; generate spec file using configure; use tar.bz2 instead of tar.gz

This commit is contained in:
Richard Dawe 2006-05-13 20:37:27 +00:00
parent 8ddf3f8789
commit e781f51fc3
7 changed files with 1287 additions and 17 deletions

1228
Doxyfile.in Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
EXTRA_DIST = COPYRIGHT OPENSOLARIS.LICENSE umem.spec
EXTRA_DIST = COPYRIGHT OPENSOLARIS.LICENSE umem.spec Doxyfile
lib_LTLIBRARIES = libumem.la
noinst_PROGRAMS = umem_test
@ -33,6 +33,17 @@ nobase_include_HEADERS = umem.h sys/vmem.h
TESTS = umem_test
html-local:
mkdir -p docs
doxygen Doxyfile
clean-local:
rm -rf docs
.PHONY: rpm
rpm: $(distdir).tar.bz2
rpmbuild -ta $<
# malloc.c
# XXX: Standalone version?

8
TODO
View file

@ -10,10 +10,10 @@ To-do List for the Linux port of umem
* ec_debug_vprintf -> something else?
* doxygen'ate the headers/code, to produce reference docs.
* rpm spec file.
* test suite.
* static library support.
* doxygen'ate the headers/code, to produce reference docs.
* HAVE_DOT in Doxyfile.in should be detected by configure.

View file

@ -1,5 +1,5 @@
AC_INIT([umem], [1.0], [], [umem])
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([dist-bzip2])
AC_PROG_CC
AM_PROG_AS
@ -10,6 +10,6 @@ AC_C_INLINE
AC_CHECK_HEADERS([sys/mman.h sys/sysmacros.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile Doxyfile umem.spec])
AC_OUTPUT

33
umem.c
View file

@ -29,7 +29,37 @@
/* #pragma ident "@(#)umem.c 1.11 05/06/08 SMI" */
/*
/*!
* \mainpage Main Page
*
* \section README
*
* \include README
*
* \section Nuances
*
* There is a nuance in the behaviour of the umem port compared
* with umem on Solaris.
*
* On Linux umem will not return memory back to the OS until umem fails
* to allocate a chunk. On failure, umem_reap() will be called automatically,
* to return memory to the OS. If your code is going to be running
* for a long time on Linux and mixes calls to different memory allocators
* (e.g.: malloc()) and umem, your code will need to call
* umem_reap() periodically.
*
* This doesn't happen on Solaris, because malloc is replaced
* with umem calls, meaning that umem_reap() is called automatically.
*
* \section References
*
* http://docs.sun.com/app/docs/doc/816-5173/6mbb8advq?a=view
*
* http://access1.sun.com/techarticles/libumem.html
*
* \section Overview
*
* \code
* based on usr/src/uts/common/os/kmem.c r1.64 from 2001/12/18
*
* The slab allocator, as described in the following two papers:
@ -332,6 +362,7 @@
* If a constructor callback _does_ do a UMEM_NOFAIL allocation, and
* the nofail callback does a non-local exit, we will leak the
* partially-constructed buffer.
* \endcode
*/
#include "config.h"

4
umem.h
View file

@ -48,13 +48,15 @@ extern void *umem_zalloc(size_t, int);
extern void umem_free(void *, size_t);
extern void umem_free_align(void *, size_t);
/*
/*!
* Flags for umem_cache_create()
*/
/*@{*/
#define UMC_NOTOUCH 0x00010000
#define UMC_NODEBUG 0x00020000
#define UMC_NOMAGAZINE 0x00040000
#define UMC_NOHASH 0x00080000
/*@}*/
struct umem_cache; /* cache structure is opaque to umem clients */

View file

@ -1,5 +1,5 @@
Name: umem
Version: 1.0
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Summary: Port of Solaris's slab allocator.
@ -30,6 +30,7 @@ and reclaming memory." (Description sourced from Wikipedia.)
%configure
%{__make}
%{__make} check
%{__make} html
%install
@ -57,7 +58,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING COPYRIGHT INSTALL NEWS OPENSOLARIS.LICENSE README TODO
%doc AUTHORS COPYING COPYRIGHT INSTALL NEWS OPENSOLARIS.LICENSE README
%{_libdir}/*.so.*
@ -76,12 +77,9 @@ of Solaris's slab allocator, libumem, to Linux.
%files devel
%defattr(-,root,root,-)
%doc AUTHORS COPYING COPYRIGHT INSTALL NEWS OPENSOLARIS.LICENSE README TODO
%doc docs/html
%{_includedir}/*.h
%{_includedir}/sys/*.h
%{_libdir}/*.so
%{_libdir}/*.a
%changelog
* Sun Mar 12 2006 Richard Dawe <rich@phekda.gotadsl.co.uk> - 1.0-1
- Initial packaging.