]> mj.ucw.cz Git - libucw.git/log
libucw.git
19 years agobugfix in obuck_slurp_refill
Robert Spalek [Wed, 18 Aug 2004 10:28:40 +0000 (10:28 +0000)]
bugfix in obuck_slurp_refill

19 years agocards format has changed, do upgrade the version of the index
Robert Spalek [Tue, 17 Aug 2004 20:17:37 +0000 (20:17 +0000)]
cards format has changed, do upgrade the version of the index

19 years agoadded a module that supports transparent compression of data streamed into
Robert Spalek [Tue, 17 Aug 2004 20:12:05 +0000 (20:12 +0000)]
added a module that supports transparent compression of data streamed into
an output fastbuf.  on the other side, reading from the stream is also
transparent

* will be used for cards
* untested

19 years agoAccept V33_LIZARD buckets without body -- such buckets can legally
Martin Mares [Sun, 15 Aug 2004 14:14:55 +0000 (14:14 +0000)]
Accept V33_LIZARD buckets without body -- such buckets can legally
arise when shep-cleanup trims an inactive bucket.

Also added debugging messages which helped to verify that zero-copy
is really invoked where it should.

19 years agoAdded sync_dir().
Martin Mares [Sun, 15 Aug 2004 12:09:57 +0000 (12:09 +0000)]
Added sync_dir().

19 years agoAdded bfilesync().
Martin Mares [Sun, 15 Aug 2004 12:09:45 +0000 (12:09 +0000)]
Added bfilesync().

19 years agoMade `buckettool -x' show the header if in verbose mode.
Martin Mares [Sun, 15 Aug 2004 10:16:03 +0000 (10:16 +0000)]
Made `buckettool -x' show the header if in verbose mode.
Also use bbcopy_slow() for copying bucket contents.

19 years agoAdded obj_find_anum() which is obj_find_aval() combined with atol() and
Martin Mares [Sat, 14 Aug 2004 15:15:53 +0000 (15:15 +0000)]
Added obj_find_anum() which is obj_find_aval() combined with atol() and
a default value (this is a very common idiom at many places).

Added size_attr() which calculates size of a given attribute in the
current bucket format.

19 years agoUTF8_SPACE turned to an inline function.
Martin Mares [Sat, 14 Aug 2004 15:14:36 +0000 (15:14 +0000)]
UTF8_SPACE turned to an inline function.
Added utf8_encoding_length() which measures expected length of an UTF-8
sequence according to its first byte.

19 years agoobj_add_attr_ref() with an on-stack buffer is not advisable, better
Martin Mares [Thu, 5 Aug 2004 22:33:19 +0000 (22:33 +0000)]
obj_add_attr_ref() with an on-stack buffer is not advisable, better
allocate the buffer in the object pool.

19 years agoWhen reading, the data end at b->bstop, not b->bufend.
Martin Mares [Thu, 5 Aug 2004 22:32:30 +0000 (22:32 +0000)]
When reading, the data end at b->bstop, not b->bufend.

19 years agoBucket fastbuf's have to be seekable, since shep-reap seeks on them
Martin Mares [Thu, 5 Aug 2004 22:28:58 +0000 (22:28 +0000)]
Bucket fastbuf's have to be seekable, since shep-reap seeks on them
(although the seek will be inside the buffer [and thence optimized out
by bseek()] under all reasonable circumstances [it was triggered by
a bug in buck2obj]).

19 years agodo not read the whole bucket into memory if only header is needed
Robert Spalek [Thu, 5 Aug 2004 14:13:56 +0000 (14:13 +0000)]
do not read the whole bucket into memory if only header is needed

19 years agoNew attributes are now added at the end of the list.
Martin Mares [Thu, 5 Aug 2004 12:13:41 +0000 (12:13 +0000)]
New attributes are now added at the end of the list.

20 years agotiny bugfix :))
Robert Spalek [Tue, 20 Jul 2004 15:16:26 +0000 (15:16 +0000)]
tiny bugfix :))

20 years agotiny optimization: do not make 2 function calls in adler32()
Robert Spalek [Tue, 20 Jul 2004 10:15:31 +0000 (10:15 +0000)]
tiny optimization: do not make 2 function calls in adler32()

20 years agoFixed two bugs in parsing of buckets (one of them introduced by me a couple
Martin Mares [Fri, 16 Jul 2004 21:56:11 +0000 (21:56 +0000)]
Fixed two bugs in parsing of buckets (one of them introduced by me a couple
of hours ago, the other aged).

20 years agoBuckets of unknown format should be skipped properly, otherwise
Martin Mares [Fri, 16 Jul 2004 20:22:53 +0000 (20:22 +0000)]
Buckets of unknown format should be skipped properly, otherwise
bucket fetching can become confused.

20 years ago`buckettool -c' (cat) now separates buckets by an empty line.
Martin Mares [Fri, 16 Jul 2004 19:08:23 +0000 (19:08 +0000)]
`buckettool -c' (cat) now separates buckets by an empty line.

20 years agoParsing of PLAIN type buckets also ends after buck_len bytes.
Martin Mares [Fri, 16 Jul 2004 18:32:35 +0000 (18:32 +0000)]
Parsing of PLAIN type buckets also ends after buck_len bytes.
obj_read_multi() is gone.

20 years agoReading of V30 buckets was broken (for example it didn't work when a bucket
Martin Mares [Fri, 16 Jul 2004 18:18:02 +0000 (18:18 +0000)]
Reading of V30 buckets was broken (for example it didn't work when a bucket
had only header and no body). When fixing it, I've modified it to terminate
after buck_len bytes, so the terminating NUL character is no longer needed.

20 years agoprune the original source code yet more
Robert Spalek [Fri, 16 Jul 2004 11:46:06 +0000 (11:46 +0000)]
prune the original source code yet more

20 years agotiny bugfix
Robert Spalek [Fri, 16 Jul 2004 10:50:14 +0000 (10:50 +0000)]
tiny bugfix

20 years agotaken much faster implementation of Adler32 and put into a separate source-code
Robert Spalek [Fri, 16 Jul 2004 10:47:37 +0000 (10:47 +0000)]
taken much faster implementation of Adler32 and put into a separate source-code

20 years agoadd Adler32 checksum to compressed V33 buckets
Robert Spalek [Fri, 16 Jul 2004 10:39:04 +0000 (10:39 +0000)]
add Adler32 checksum to compressed V33 buckets

20 years agoadded adler32 functions
Robert Spalek [Fri, 16 Jul 2004 10:25:49 +0000 (10:25 +0000)]
added adler32 functions

20 years agoautomatically add 0x80000000 to bucket-type specified on the command-line
Robert Spalek [Fri, 16 Jul 2004 10:12:33 +0000 (10:12 +0000)]
automatically add 0x80000000 to bucket-type specified on the command-line

20 years agoimproved an error message to catch an error
Robert Spalek [Fri, 16 Jul 2004 09:07:50 +0000 (09:07 +0000)]
improved an error message to catch an error

20 years agoAdded {b,}put_attr_separator().
Martin Mares [Thu, 15 Jul 2004 21:52:29 +0000 (21:52 +0000)]
Added {b,}put_attr_separator().

20 years agoIntroduced late matchers and custom statistics [see Bug #860]. Converted
Martin Mares [Mon, 12 Jul 2004 14:13:23 +0000 (14:13 +0000)]
Introduced late matchers and custom statistics [see Bug #860]. Converted
FILETYPE to this mechanism, it's no longer an exception.

20 years agopools.h -> mempool.h
Martin Mares [Sat, 10 Jul 2004 21:05:27 +0000 (21:05 +0000)]
pools.h -> mempool.h

20 years agoI always wanted to rename the rather inconsistent memory pool modules.
Martin Mares [Sat, 10 Jul 2004 21:04:23 +0000 (21:04 +0000)]
I always wanted to rename the rather inconsistent memory pool modules.
After the big library earthquake I caused with my unicode.h changes,
this is the small fish, so let's go.

20 years agoArranged the module list.
Martin Mares [Sat, 10 Jul 2004 20:56:56 +0000 (20:56 +0000)]
Arranged the module list.

20 years agoMoved object reading and writing functions where they belong.
Martin Mares [Sat, 10 Jul 2004 20:46:55 +0000 (20:46 +0000)]
Moved object reading and writing functions where they belong.

20 years agoMany programs now don't need to link with libcharset.
Martin Mares [Sat, 10 Jul 2004 20:43:22 +0000 (20:43 +0000)]
Many programs now don't need to link with libcharset.

20 years agoRenamed fb-printf to ff-printf to keep fastbuf front-ends and back-ends apart.
Martin Mares [Sat, 10 Jul 2004 20:39:31 +0000 (20:39 +0000)]
Renamed fb-printf to ff-printf to keep fastbuf front-ends and back-ends apart.

20 years agoAdapted to new unicode includes.
Martin Mares [Sat, 10 Jul 2004 20:38:38 +0000 (20:38 +0000)]
Adapted to new unicode includes.

20 years agoAdjust includes.
Martin Mares [Sat, 10 Jul 2004 20:37:05 +0000 (20:37 +0000)]
Adjust includes.

20 years agoUnicode character type functions moved to charset/unicat.h
Martin Mares [Sat, 10 Jul 2004 20:36:55 +0000 (20:36 +0000)]
Unicode character type functions moved to charset/unicat.h
charset/unicode.h removed, because it's now empty.

20 years agoGone (some functions moved to the main lib, some were unused).
Martin Mares [Sat, 10 Jul 2004 20:36:06 +0000 (20:36 +0000)]
Gone (some functions moved to the main lib, some were unused).

20 years agoMoved the basic Unicode and UTF-8 functions to the main library.
Martin Mares [Sat, 10 Jul 2004 20:35:31 +0000 (20:35 +0000)]
Moved the basic Unicode and UTF-8 functions to the main library.

20 years agoMoved UTF-8 streams to lib/ff-utf8.[ch] (`ff' prefix will denote fastbuf
Martin Mares [Sat, 10 Jul 2004 20:34:27 +0000 (20:34 +0000)]
Moved UTF-8 streams to lib/ff-utf8.[ch]  (`ff' prefix will denote fastbuf
front-ends, `fb' will be the back-ends).

20 years agopatch obj_write{,_nocheck}() to use bput_attr_str() to support both V30 and V33 buckets
Robert Spalek [Sat, 10 Jul 2004 16:26:54 +0000 (16:26 +0000)]
patch obj_write{,_nocheck}() to use bput_attr_str() to support both V30 and V33 buckets

20 years agofbbuf_init_read() now has can_overwrite as an extra parameter.
Martin Mares [Tue, 6 Jul 2004 19:35:46 +0000 (19:35 +0000)]
fbbuf_init_read() now has can_overwrite as an extra parameter.

20 years agoUse bfilesize().
Martin Mares [Tue, 6 Jul 2004 11:18:48 +0000 (11:18 +0000)]
Use bfilesize().

20 years agoIntroduced bfilesize().
Martin Mares [Tue, 6 Jul 2004 11:18:27 +0000 (11:18 +0000)]
Introduced bfilesize().

20 years agoRemoved references to buck2obj.h and obj2buck.h.
Martin Mares [Tue, 6 Jul 2004 11:03:48 +0000 (11:03 +0000)]
Removed references to buck2obj.h and obj2buck.h.

20 years agoAdded #ifdef guards.
Martin Mares [Tue, 6 Jul 2004 11:03:25 +0000 (11:03 +0000)]
Added #ifdef guards.

20 years agoMerged obj2buck.h and buck2obj.h to object.h, the number of includes
Martin Mares [Tue, 6 Jul 2004 11:02:45 +0000 (11:02 +0000)]
Merged obj2buck.h and buck2obj.h to object.h, the number of includes
started to grow insane.

20 years agoNo need to test for NULL when reallocating.
Martin Mares [Tue, 6 Jul 2004 10:52:51 +0000 (10:52 +0000)]
No need to test for NULL when reallocating.

20 years agoAdded a note on xrealloc(NULL, x).
Martin Mares [Tue, 6 Jul 2004 10:52:31 +0000 (10:52 +0000)]
Added a note on xrealloc(NULL, x).

20 years agoUse bbuf.h.
Martin Mares [Tue, 6 Jul 2004 10:45:27 +0000 (10:45 +0000)]
Use bbuf.h.

20 years agoInclude <stdlib.h> to get free().
Martin Mares [Tue, 6 Jul 2004 10:45:09 +0000 (10:45 +0000)]
Include <stdlib.h> to get free().

20 years agoUse lib/bbuf.h here.
Martin Mares [Tue, 6 Jul 2004 10:44:43 +0000 (10:44 +0000)]
Use lib/bbuf.h here.

20 years agoApplications of gbuf.h to byte arrays are very common, so I've introduced
Martin Mares [Tue, 6 Jul 2004 10:44:20 +0000 (10:44 +0000)]
Applications of gbuf.h to byte arrays are very common, so I've introduced
a special include for them.

20 years agocan_overwrite_buffer fixes for bucket.c: added f->buffer resetting and
Martin Mares [Tue, 6 Jul 2004 10:36:47 +0000 (10:36 +0000)]
can_overwrite_buffer fixes for bucket.c: added f->buffer resetting and
also don't forget to set can_overwrite_buffer on slurp fastbufs (this
involves a little dirty trick, see the comment).

20 years agofb-limfd was setting can_overwrite_buffer=2, but it forgot to do the buffer
Martin Mares [Tue, 6 Jul 2004 10:24:21 +0000 (10:24 +0000)]
fb-limfd was setting can_overwrite_buffer=2, but it forgot to do the buffer
resetting magic needed by bdirect_read_commit_modified().

20 years agoComplain loudly if anybody asks us to generate buckets of an unknown
Martin Mares [Tue, 6 Jul 2004 10:19:44 +0000 (10:19 +0000)]
Complain loudly if anybody asks us to generate buckets of an unknown
type (this can happen e.g. in the buckettool).

20 years agoSmall improvements to buckettool:
Martin Mares [Tue, 6 Jul 2004 10:18:03 +0000 (10:18 +0000)]
Small improvements to buckettool:

  o  Options are sorted alphabetically.
  o  dump_oattr() replaced by dump_oattrs() which dumps all the
     attributes.
  o  ASSERT that the bucket type is known.

20 years ago- use buck2obj_parse() instead of obj_read_bucket() to separate the header
Robert Spalek [Sun, 4 Jul 2004 11:30:53 +0000 (11:30 +0000)]
- use buck2obj_parse() instead of obj_read_bucket() to separate the header
  and the body
- use the new interface for writing the attributes to the buckets

20 years agowriting attributes to buckets totally rewritten according to MJ's remarks
Robert Spalek [Sun, 4 Jul 2004 11:29:54 +0000 (11:29 +0000)]
writing attributes to buckets totally rewritten according to MJ's remarks

20 years ago- obj_parse_dump() generalized to store apart the header and the body, and
Robert Spalek [Sun, 4 Jul 2004 11:29:17 +0000 (11:29 +0000)]
- obj_parse_dump() generalized to store apart the header and the body, and
  renamed to buck2obj_parse()
- added new obj_parse_dump() with the same interface as before; it is a
  wrapper of buck2obj_parse()

20 years agoa typo and FIXME
Robert Spalek [Mon, 28 Jun 2004 15:46:45 +0000 (15:46 +0000)]
a typo and FIXME

20 years agonow, I have no contribution into the fastbuf code :))
Robert Spalek [Mon, 28 Jun 2004 15:40:03 +0000 (15:40 +0000)]
now, I have no contribution into the fastbuf code :))

20 years agoAdapted buck2obj to the new rewritable buffers. I don't like too much
Martin Mares [Mon, 28 Jun 2004 15:07:56 +0000 (15:07 +0000)]
Adapted buck2obj to the new rewritable buffers. I don't like too much
what I did with the `copied' variable, but I didn't know better.

Also, I've added the missing bdirect commits.

20 years agoA better implementation of overwritable buffers.
Martin Mares [Mon, 28 Jun 2004 15:06:40 +0000 (15:06 +0000)]
A better implementation of overwritable buffers.

20 years agoone mis-commit fixed
Robert Spalek [Mon, 28 Jun 2004 13:59:03 +0000 (13:59 +0000)]
one mis-commit fixed

20 years agoobj_read_bucket() checks whether buck_type has a correct value
Robert Spalek [Mon, 28 Jun 2004 13:06:53 +0000 (13:06 +0000)]
obj_read_bucket() checks whether buck_type has a correct value

20 years agodump_parsed_bucket() simplified
Robert Spalek [Mon, 28 Jun 2004 12:59:14 +0000 (12:59 +0000)]
dump_parsed_bucket() simplified

20 years ago- obj_read_bucket() takes a new parameter: struct mempool *pool
Robert Spalek [Mon, 28 Jun 2004 12:53:34 +0000 (12:53 +0000)]
- obj_read_bucket() takes a new parameter: struct mempool *pool
- buck2obj_alloc() takes no parameters at all now

20 years agointerface of lizard_decompress_safe() has been simplified
Robert Spalek [Mon, 28 Jun 2004 12:13:29 +0000 (12:13 +0000)]
interface of lizard_decompress_safe() has been simplified

20 years agoavoid one pointer
Robert Spalek [Mon, 28 Jun 2004 12:04:22 +0000 (12:04 +0000)]
avoid one pointer

20 years agoobj_read_bucket()
Robert Spalek [Mon, 28 Jun 2004 12:00:38 +0000 (12:00 +0000)]
obj_read_bucket()
- never tampers the fastbuf when parsing the header
- the body might by tampered under very special (and well commented) conditions

20 years agodeleted obj_attr_to_bucket*(). sorry, I like them, however I have already
Robert Spalek [Mon, 28 Jun 2004 11:44:00 +0000 (11:44 +0000)]
deleted obj_attr_to_bucket*().  sorry, I like them, however I have already
converted all sources to my version of these functions.  if we reintroduce
them, let us put them to obj2buck.[ch]

20 years ago- buckettool updated to extract, cat, and create all kinds of buckets
Robert Spalek [Mon, 28 Jun 2004 09:50:14 +0000 (09:50 +0000)]
- buckettool updated to extract, cat, and create all kinds of buckets
- added parameter -r for raw (non-parsed) output

20 years agomacros and inline functions for generating V33 buckets
Robert Spalek [Mon, 28 Jun 2004 09:49:29 +0000 (09:49 +0000)]
macros and inline functions for generating V33 buckets

20 years ago- added buck2obj_flush() that flushed the memory pool (some caller only
Robert Spalek [Mon, 28 Jun 2004 09:45:49 +0000 (09:45 +0000)]
- added buck2obj_flush() that flushed the memory pool (some caller only
  remember struct buck2obj_buf * and since it is not exported, they could not
  flush it by themselves)
- obj_read_bucket() returns the length of the header if requested
- adapted to growing buffers (gbuf.h)
- updated interface of bconfig()
- lizard_decompress_safe() automatically realloc's the buffer, hence the
  wrapper is not needed

20 years agoBCONFIG_CAN_OVERWRITE is a read/write parameter, i.e. the used can
Robert Spalek [Mon, 28 Jun 2004 09:38:20 +0000 (09:38 +0000)]
BCONFIG_CAN_OVERWRITE is a read/write parameter, i.e. the used can
temporarily lower the rights.  I need it somewhere.

20 years agoupdated interface of lizard-safe.c
Robert Spalek [Mon, 28 Jun 2004 09:35:00 +0000 (09:35 +0000)]
updated interface of lizard-safe.c

20 years ago- encapsulation: hide struct lizard_buffer in the source code
Robert Spalek [Mon, 28 Jun 2004 09:34:27 +0000 (09:34 +0000)]
- encapsulation: hide struct lizard_buffer in the source code
  ===> interface changed, now it returns the pointer in one extra parameter
- lizard_alloc() allocates no memory, hence no size parameter needed
- lizard_realloc() made static and it is automatically called by the
  decompression routine

20 years agoadded a simple source-code for resizable buffers, I am going to need it at
Robert Spalek [Mon, 28 Jun 2004 09:30:52 +0000 (09:30 +0000)]
added a simple source-code for resizable buffers, I am going to need it at
3 places, so let us separate it

20 years agobigfix, now it works even for the 2nd time :-)
Robert Spalek [Mon, 28 Jun 2004 09:30:13 +0000 (09:30 +0000)]
bigfix, now it works even for the 2nd time :-)

20 years agoMore checks.
Martin Mares [Sun, 27 Jun 2004 16:58:46 +0000 (16:58 +0000)]
More checks.

20 years agoAdjusted the checker.
Martin Mares [Sun, 27 Jun 2004 16:04:16 +0000 (16:04 +0000)]
Adjusted the checker.

20 years agoAdded a script for testing compilability of different feature sets.
Martin Mares [Sun, 27 Jun 2004 15:37:43 +0000 (15:37 +0000)]
Added a script for testing compilability of different feature sets.

20 years agoobj_read_bucket() now gets the bucket length as a parameter, because
Martin Mares [Sun, 27 Jun 2004 14:10:47 +0000 (14:10 +0000)]
obj_read_bucket() now gets the bucket length as a parameter, because
in many cases, the fastbuf continues after the end of the bucket.

If a V30 bucket ends with a NUL byte, eat that byte as well.

Also introduced obj_attr_to_bucket{,_num}() -- these functions take
a single attribute and encode it using the specified bucket type
for inclusion at the beginning of the bucket header. These functions
probably belong to obj2buck instead, but currently there is no such
file, so I'm leaving the moving to you.

20 years agoAdded bskip() which skips the given number of bytes by reading.
Martin Mares [Sun, 27 Jun 2004 13:44:15 +0000 (13:44 +0000)]
Added bskip() which skips the given number of bytes by reading.
In the future, we can optimize it by seeking when possible.

20 years agoMinor optimizations.
Martin Mares [Sun, 27 Jun 2004 12:27:24 +0000 (12:27 +0000)]
Minor optimizations.

20 years agogetbuck.c no longer starts with flushing the memory pool, since it belongs
Robert Spalek [Fri, 25 Jun 2004 19:00:20 +0000 (19:00 +0000)]
getbuck.c no longer starts with flushing the memory pool, since it belongs
to the caller.  hence I have added mp_flush() back everywhere again

20 years ago- buck2obj_alloc() initially allocates no buffers
Robert Spalek [Fri, 25 Jun 2004 18:45:56 +0000 (18:45 +0000)]
- buck2obj_alloc() initially allocates no buffers
- buck2obj_realloc() only stretches the main buffer (and not the lizard)
  + it is not exported anymore
- if lizard_decompress_safe() returns EFBIG, its buffer is shrinked

hence buck2obj.c allocates no memory if not needed.  the internal buffer is
allocated when the first non-compact bucket is encountered and lizard's
buffer is allocated when the first compressed bucket is encountered.

20 years agoTried to improve the LZO format description.
Martin Mares [Fri, 25 Jun 2004 18:45:43 +0000 (18:45 +0000)]
Tried to improve the LZO format description.

20 years ago- lizard_alloc() does not allocate anything if max_len == 0
Robert Spalek [Fri, 25 Jun 2004 18:41:45 +0000 (18:41 +0000)]
- lizard_alloc() does not allocate anything if max_len == 0
- lizard_realloc() only allows stretching the memory and not shrinking

20 years agoA little grammar fix.
Martin Mares [Fri, 25 Jun 2004 17:44:29 +0000 (17:44 +0000)]
A little grammar fix.

20 years agobuck2obj_convert() renamed to obj_read_bucket()
Robert Spalek [Fri, 25 Jun 2004 17:30:11 +0000 (17:30 +0000)]
buck2obj_convert() renamed to obj_read_bucket()

20 years agoit is possible to specify whether the caller only wants the header or also
Robert Spalek [Fri, 25 Jun 2004 16:58:55 +0000 (16:58 +0000)]
it is possible to specify whether the caller only wants the header or also
the body

20 years agodefine BUCK2OBJ_INITIAL_MAX_LEN
Robert Spalek [Fri, 25 Jun 2004 16:42:00 +0000 (16:42 +0000)]
define BUCK2OBJ_INITIAL_MAX_LEN

20 years agouse lizard_realloc() instead of {free,alloc}
Robert Spalek [Fri, 25 Jun 2004 16:41:42 +0000 (16:41 +0000)]
use lizard_realloc() instead of {free,alloc}

20 years agoadded lizard_realloc() to avoid restoring and reestablishing SIGSEGv handler
Robert Spalek [Fri, 25 Jun 2004 16:37:50 +0000 (16:37 +0000)]
added lizard_realloc() to avoid restoring and reestablishing SIGSEGv handler

20 years agoadded buck2obj_realloc(), it is automatically called when needed
Robert Spalek [Fri, 25 Jun 2004 16:28:16 +0000 (16:28 +0000)]
added buck2obj_realloc(), it is automatically called when needed

20 years agoMJ's objections:
Robert Spalek [Fri, 25 Jun 2004 15:35:57 +0000 (15:35 +0000)]
MJ's objections:
- test can_overwrite outside the loop in decode_attributes()
- mp_alloc() -> mp_alloc_fast_noalign()
- MAX() is a macro, be careful
- do not call bflush(body), but comment it in the header file