Branch: Tag:

2017-07-25

2017-07-25 20:46:28 by Martin Nilsson <nilsson@fastmail.com>

Added comment.

2017-07-17

2017-07-17 15:30:05 by Martin Nilsson <nilsson@fastmail.com>

unsigned INT64 -> UINT64

2017-04-11

2017-04-11 09:11:31 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Build: Changed API for CAST_STRUCT_LITERAL().

Fixes build issues with some compilers.

2017-04-11 09:04:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Configure: Probe support for C99-style struct literal expressions.

In C99 the expression syntax was extended to allow struct literals
in expressions, provided that they are preceeded by a suitable cast.

Adds macro CAST_STRUCT_LITERAL(), and updates buffer.h to use it.

Potential fix for build failures on NT.

2017-01-21

2017-01-21 22:27:53 by Arne Goedeke <el@laramies.com>

byte buffer: reorganize struct

The previous layout did lead to better code in small test cases,
however in most situations in Pike it is not benefitial. The new layout
makes checking the buffer space more expensive, but we only have to
update the destination pointer after writing data into the buffer.

2017-01-21 22:27:53 by Arne Goedeke <el@laramies.com>

byte_buffer: added APIs for set/get

This will be used for updating jmp instructions.

2017-01-21 22:27:53 by Arne Goedeke <el@laramies.com>

byte_buffer: added flags to control growth

The way the buffer growth (exponential or not) can now be controlled by
setting flags. Additionally there is a flag to toggle between standard
realloc and mexec_realloc. This will be used to allocate space for
generating machine code.

2017-01-02

2017-01-02 10:52:31 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Build [C99]: Removed #include of <stdint.h>.

It doesn't seem to be used.

Fixes compilation issues on Solaris 8.

2017-01-01

2017-01-01 17:51:41 by Arne Goedeke <el@laramies.com>

byte_buffer: added API for exact allocation size

In some situations we know almost for sure how much data we will write
into the buffer. In those situations we do not want to always allocate
power of 2 sized buffer. Instead, this new API allows growing the buffer
by exactly as many bytes as needed.

Some other small changes:
* added a bit of documentation.
* generate a fatal on size overflow only in debug mode.

2016-12-31

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

buffer: added buffer_get_string

buffer_get_string returns a zero terminated string. This is used when
e.g. printing from a buffer to stderr.

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

buffer: added _nothrow variants

This variant of buffer_ensure_space() will return 0 instead of
throwing an exception in OOM situation. It is sometimes easier to
handle this explicitly, than registering an exception handler.

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

New byte buffer

This new byte buffer implements a simple dynamic buffer. It aims to

* Provide a clean API.
* Convince the compiler to generate good code. In particular it tries
to avoid unnecessary loads and stores which are otherwise generated
due to the C aliasing rules. This is done using the STATIC_ASSUME(X)
macro, which declare !X as unreachable.
* Have the fast path (when the buffer has enough space) completely
inlined to allow the compiler to batch single byte writes to the
buffer into larger stores.

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

buffer: added buffer_advance()

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

buffer: do not include pike_error

Including pike_error.h from within buffer.h creates all kinds of
problems. Since we only use it with debug enabled, we can move that code
into buffer.c.

2016-12-29

2016-12-29 15:03:02 by Arne Goedeke <el@laramies.com>

buffer: added buffer_get_string

buffer_get_string returns a zero terminated string. This is used when
e.g. printing from a buffer to stderr.

2016-12-29 15:03:00 by Arne Goedeke <el@laramies.com>

buffer: do not include pike_error

Including pike_error.h from within buffer.h creates all kinds of
problems. Since we only use it with debug enabled, we can move that code
into buffer.c.

2016-12-29 15:02:35 by Arne Goedeke <el@laramies.com>

buffer: added buffer_advance()

2016-12-29 15:02:35 by Arne Goedeke <el@laramies.com>

buffer: added _nothrow variants

This variant of buffer_ensure_space() will return 0 instead of
throwing an exception in OOM situation. It is sometimes easier to
handle this explicitly, than registering an exception handler.

2016-12-29 15:02:29 by Arne Goedeke <el@laramies.com>

New byte buffer

This new byte buffer implements a simple dynamic buffer. It aims to

* Provide a clean API.
* Convince the compiler to generate good code. In particular it tries
to avoid unnecessary loads and stores which are otherwise generated
due to the C aliasing rules. This is done using the STATIC_ASSUME(X)
macro, which declare !X as unreachable.
* Have the fast path (when the buffer has enough space) completely
inlined to allow the compiler to batch single byte writes to the
buffer into larger stores.

2016-11-10

2016-11-10 16:38:44 by Arne Goedeke <el@laramies.com>

buffer: added _nothrow variants

This variant of buffer_ensure_space() will return 0 instead of
throwing an exception in OOM situation. It is sometimes easier to
handle this explicitly, than registering an exception handler.

2016-11-08

2016-11-08 12:38:24 by Arne Goedeke <el@laramies.com>

New byte buffer

This new byte buffer implements a simple dynamic buffer. It aims to

* Provide a clean API.
* Convince the compiler to generate good code. In particular it tries
to avoid unnecessary loads and stores which are otherwise generated
due to the C aliasing rules. This is done using the STATIC_ASSUME(X)
macro, which declare !X as unreachable.
* Have the fast path (when the buffer has enough space) completely
inlined to allow the compiler to batch single byte writes to the
buffer into larger stores.