lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Roberto Ierusalimschy once stated:
> 
> > Finally there is an alignment/padding feature in this new pack/unpack
> > code. But the padding value used when packing is not specified. Being
> > able to configure the value would be a bit too much, but I think you
> > should at least define the value you use (if it's currently undefined)
> > and document it.
> 
> It is 0. We will document that.

  Any chance for a way to change it?  I often use 0xCC [1] on Intel
platforms to initialize "un-initialized" memory when debugging.

  -spc (A 0 value is just too predictable 8-P

[1]	0xCC on Intel because that's INT 3, the breakpoint instruction.  If
	it's executed, it causes a breakpoint (which either core dumps if
	you aren't running under a debugger, or at the debugger's prompt if
	you are).  A run of 0xCC as UTF-8 creates an invalid character (and
	if you are only expecting ASCII, a sure sign of a problem).  As a
	signed integer, it's a fairly large negative number, and as an
	unsigned number, it's a large positive number.  And as an
	address---well, it's most likely a bogus address.

	The value to use on other platforms varies---on the Motorola 68K
	series, it's 0xA1 (unimplemented opcodes if executed, breaks UTF-8
	sequences, unusual integer values, etc).